Commit 3a584441 authored by Toshi MARUYAMA's avatar Toshi MARUYAMA Committed by Eric Davis

PDF: update rfpdf (#61).

https://github.com/edwinmoss/rfpdf
revision a04724b4af95c15a99675b34e353c15534d20411

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5247 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent e06b5815
......@@ -11,3 +11,4 @@
* Added :filename option in this hash
If you're using the same settings for @options_for_rfpdf often, you might want to
put your assignment in a before_filter (perhaps overriding :filename, etc in your actions).
1.15 2009-11-20 Rails 2.* support - Thanks to Prawnto plugin for showing the way to the new TemplateHandler
\ No newline at end of file
FWIW - I am migrating my apps to Prawn and Prawnto
= RFPDF Template Plugin
A template plugin allowing the inclusion of ERB-enabled RFPDF template files.
== Example .rb method Usage
==
==
== TCPDF Version (The New or UTF8 Version)
==
==
If you are using HTML, it is recommended you install:
In the controller, something like:
gem install -r htmlentities
def mypdf
pdf = FPDF.new()
TCPDF Documentation located at:
#
# Chinese
#
pdf.extend(PDF_Chinese)
pdf.AddPage
pdf.AddBig5Font
pdf.SetFont('Big5','',18)
pdf.Write(5, '²{®É®ð·Å 18 C Àã«× 83 %')
icBig5 = Iconv.new('Big5', 'UTF-8')
pdf.Write(15, icBig5.iconv("宋体 should be working"))
send_data pdf.Output, :filename => "something.pdf", :type => "application/pdf"
end
http://phpdocs.moodle.org/com-tecnick-tcpdf/TCPDF.html
== Example .rfdf Usage
Example of simple use in .rhtml:
In the controller, something like:
<%
@pdf = TCPDF.new()
@pdf.SetMargins(15, 27, 15);
@pdf.AddPage();
text_options = {:font => "freeserif"}
@pdf.draw_text(15, 10, "text", {:font_size => 12, :font => "freeserif"})
%><%=@pdf.Output()%>
def mypdf
@options_for_rfpdf ||= {}
@options_for_rfpdf[:file_name] = "nice_looking.pdf"
end
See the following files for sample of useage:
In the layout (make sure this is the only item in the layout):
<%= @content_for_layout %>
In the view (mypdf.rfpdf):
test_unicode.rfpdf
utf8test.txt
logo_example.png
<%
pdf = FPDF.new()
#
# Chinese
#
pdf.extend(PDF_Chinese)
pdf.AddPage
pdf.AddBig5Font
pdf.SetFont('Big5','',18)
pdf.Write(5, '²{®É®ð·Å 18 C Àã«× 83 %')
icBig5 = Iconv.new('Big5', 'UTF-8')
pdf.Write(15, icBig5.iconv("宋体 should be working"))
#
# Japanese
#
pdf.extend(PDF_Japanese)
pdf.AddSJISFont();
pdf.AddPage();
pdf.SetFont('SJIS','',18);
pdf.Write(5,'9ÉñåéÇÃåˆäJÉeÉXÉgÇåoǃPHP 3.0ÇÕ1998îN6åéÇ…åˆéÆÇ…ÉäÉäÅ[ÉXÇ≥ÇÍNjǵÇΩÅB');
icSJIS = Iconv.new('SJIS', 'UTF-8')
pdf.Write(15, icSJIS.iconv("これはテキストである should be working"))
#
# Korean
#
pdf.extend(PDF_Korean)
pdf.AddUHCFont();
pdf.AddPage();
pdf.SetFont('UHC','',18);
pdf.Write(5,'PHP 3.0Àº 1998³â 6¿ù¿¡ °ø½ÄÀûÀ¸·Î ¸±¸®ÁîµÇ¾ú´Ù. °ø°³ÀûÀÎ Å×½ºÆ® ÀÌÈľà 9°³¿ù¸¸À̾ú´Ù.');
icUHC = Iconv.new('UHC', 'UTF-8')
pdf.Write(15, icUHC.iconv("이것은 원본 이다"))
#
# English
#
pdf.AddPage();
pdf.SetFont('Arial', '', 10)
pdf.Write(5, "should be working")
%>
<%= pdf.Output() %>
== Configuring
You can configure Rfpdf by using an @options_for_rfpdf hash in your controllers.
Here are a few options:
:filename (default: action_name.pdf)
Filename of PDF to generate
Note: If you're using the same settings for @options_for_rfpdf often, you might want to
put your assignment in a before_filter (perhaps overriding :filename, etc in your actions).
== Problems
Layouts and partials are currently not supported; just need
to wrap the PDF generation differently.
FPDF users can migrate to TCPDF by changing the following from:
pdf = FPDF.new
to:
pdf = TCPDF.new
ENJOY!
\ No newline at end of file
require 'rfpdf'
begin
ActionView::Template::register_template_handler 'rfpdf', RFPDF::View
rescue NameError
# Rails < 2.1
RFPDF::View.backward_compatibility_mode = true
ActionView::Base::register_template_handler 'rfpdf', RFPDF::View
require('htmlentities')
rescue LoadError
# This gem is not required - just nice to have.
end
require('cgi')
require 'rfpdf'
Mime::Type.register "application/pdf", :pdf
ActionView::Template::register_template_handler 'rfpdf', RFPDF::TemplateHandlers::Base
#============================================================+
# File name : barcode.rb
# Begin : 2002-07-31
# Last Update : 2005-01-02
# Author : Karim Mribti [barcode@mribti.com]
# Version : 1.1 [0.0.8a (original code)]
# License : GNU LGPL (Lesser General Public License) 2.1
# http://www.gnu.org/copyleft/lesser.txt
# Source Code : http://www.mribti.com/barcode/
#
# Description : Generic Barcode Render Class for PHP using
# the GD graphics library.
#
# NOTE:
# This version contains changes by Nicola Asuni:
# - porting to Ruby
# - code style and formatting
# - automatic php documentation in PhpDocumentor Style
# (www.phpdoc.org)
# - minor bug fixing
# - $mCharSet and $mChars variables were added here
#============================================================+
#
# Barcode Render Class for PHP using the GD graphics library.
# @author Karim Mribti, Nicola Asuni
# @name BarcodeObject
# @package com.tecnick.tcpdf
# @@version 0.0.8a 2001-04-01 (original code)
# @since 2001-03-25
# @license http://www.gnu.org/copyleft/lesser.html LGPL
#
# Styles
# Global
#
# option: generate barcode border
#
define("BCS_BORDER", 1);
#
# option: use transparent background
#
define("BCS_TRANSPARENT", 2);
#
# option: center barcode
#
define("BCS_ALIGN_CENTER", 4);
#
# option: align left
#
define("BCS_ALIGN_LEFT", 8);
#
# option: align right
#
define("BCS_ALIGN_RIGHT", 16);
#
# option: generate JPEG image
#
define("BCS_IMAGE_JPEG", 32);
#
# option: generate PNG image
#
define("BCS_IMAGE_PNG", 64);
#
# option: draw text
#
define("BCS_DRAW_TEXT", 128);
#
# option: stretch text
#
define("BCS_STRETCH_TEXT", 256);
#
# option: reverse color
#
define("BCS_REVERSE_COLOR", 512);
#
# option: draw check
# (only for I25 code)
#
define("BCS_I25_DRAW_CHECK", 2048);
#
# set default background color
#
define("BCD_DEFAULT_BACKGROUND_COLOR", 0xFFFFFF);
#
# set default foreground color
#
define("BCD_DEFAULT_FOREGROUND_COLOR", 0x000000);
#
# set default style options
#
define("BCD_DEFAULT_STYLE", BCS_BORDER | BCS_ALIGN_CENTER | BCS_IMAGE_PNG);
#
# set default width
#
define("BCD_DEFAULT_WIDTH", 460);
#
# set default height
#
define("BCD_DEFAULT_HEIGHT", 120);
#
# set default font
#
define("BCD_DEFAULT_FONT", 5);
#
# st default horizontal resolution
#
define("BCD_DEFAULT_XRES", 2);
# Margins
#
# set default margin
#
define("BCD_DEFAULT_MAR_Y1", 0);
#
# set default margin
#
define("BCD_DEFAULT_MAR_Y2", 0);
#
# set default text offset
#
define("BCD_DEFAULT_TEXT_OFFSET", 2);
# For the I25 Only
#
# narrow bar option
# (only for I25 code)
#
define("BCD_I25_NARROW_BAR", 1);
#
# wide bar option
# (only for I25 code)
#
define("BCD_I25_WIDE_BAR", 2);
# For the C39 Only
#
# narrow bar option
# (only for c39 code)
#
define("BCD_C39_NARROW_BAR", 1);
#
# wide bar option
# (only for c39 code)
#
define("BCD_C39_WIDE_BAR", 2);
# For Code 128
#
# set type 1 bar
# (only for c128 code)
#
define("BCD_C128_BAR_1", 1);
#
# set type 2 bar
# (only for c128 code)
#
define("BCD_C128_BAR_2", 2);
#
# set type 3 bar
# (only for c128 code)
#
define("BCD_C128_BAR_3", 3);
#
# set type 4 bar
# (only for c128 code)
#
define("BCD_C128_BAR_4", 4);
#
# Barcode Render Class for PHP using the GD graphics library.
# @author Karim Mribti, Nicola Asuni
# @name BarcodeObject
# @package com.tecnick.tcpdf
# @@version 0.0.8a 2001-04-01 (original code)
# @since 2001-03-25
# @license http://www.gnu.org/copyleft/lesser.html LGPL
#
class BarcodeObject {
#
# @var Image width in pixels.
# @access protected
#
protected $mWidth;
#
# @var Image height in pixels.
# @access protected
#
protected $mHeight;
#
# @var Numeric code for Barcode style.
# @access protected
#
protected $mStyle;
#
# @var Background color.
# @access protected
#
protected $mBgcolor;
#
# @var Brush color.
# @access protected
#
protected $mBrush;
#
# @var Image object.
# @access protected
#
protected $mImg;
#
# @var Numeric code for character font.
# @access protected
#
protected $mFont;
#
# @var Error message.
# @access protected
#
protected $mError;
#
# @var Character Set.
# @access protected
#
protected $mCharSet;
#
# @var Allowed symbols.
# @access protected
#
protected $mChars;
#
# Class Constructor.
# @param int $Width Image width in pixels.
# @param int $Height Image height in pixels.
# @param int $Style Barcode style.
#
def __construct($Width=BCD_DEFAULT_WIDTH, $Height=BCD_DEFAULT_HEIGHT, $Style=BCD_DEFAULT_STYLE)
@mWidth = $Width;
@mHeight = $Height;
@mStyle = $Style;
@mFont = BCD_DEFAULT_FONT;
@mImg = ImageCreate(@mWidth, @mHeight);
$dbColor = @mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_FOREGROUND_COLOR : BCD_DEFAULT_BACKGROUND_COLOR;
$dfColor = @mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_BACKGROUND_COLOR : BCD_DEFAULT_FOREGROUND_COLOR;
@mBgcolor = ImageColorAllocate(@mImg, ($dbColor & 0xFF0000) >> 16,
($dbColor & 0x00FF00) >> 8, $dbColor & 0x0000FF);
@mBrush = ImageColorAllocate(@mImg, ($dfColor & 0xFF0000) >> 16,
($dfColor & 0x00FF00) >> 8, $dfColor & 0x0000FF);
if (!(@mStyle & BCS_TRANSPARENT))
ImageFill(@mImg, @mWidth, @mHeight, @mBgcolor);
end
end
#
# Class Destructor.
# Destroy image object.
#
def __destructor()
@DestroyObject();
end
#
# Returns the image object.
# @return object image.
# @author Nicola Asuni
# @since 1.5.2
#
def getImage()
return @mImg;
end
#
# Abstract method used to draw the barcode image.
# @param int $xres Horizontal resolution.
#
def DrawObject($xres) {
# there is not implementation neded, is simply the asbsract function.#
return false;
end
#
# Draws the barcode border.
# @access protected
#
protected function DrawBorder()
ImageRectangle(@mImg, 0, 0, @mWidth-1, @mHeight-1, @mBrush);
end
#
# Draws the alphanumeric code.
# @param int $Font Font type.
# @param int $xPos Horiziontal position.
# @param int $yPos Vertical position.
# @param int $Char Alphanumeric code to write.
# @access protected
#
protected function DrawChar($Font, $xPos, $yPos, $Char)
ImageString(@mImg,$Font,$xPos,$yPos,$Char,@mBrush);
end
#
# Draws a character string.
# @param int $Font Font type.
# @param int $xPos Horiziontal position.
# @param int $yPos Vertical position.
# @param int $Char string to write.
# @access protected
#
protected function DrawText($Font, $xPos, $yPos, $Char)
ImageString(@mImg,$Font,$xPos,$yPos,$Char,@mBrush);
end
#
# Draws a single barcode bar.
# @param int $xPos Horiziontal position.
# @param int $yPos Vertical position.
# @param int $xSize Horizontal size.
# @param int $xSize Vertical size.
# @return bool trur in case of success, false otherwise.
# @access protected
#
protected function DrawSingleBar($xPos, $yPos, $xSize, $ySize)
if ($xPos>=0 && $xPos<=@mWidth && ($xPos+$xSize)<=@mWidth &&
$yPos>=0 && $yPos<=@mHeight && ($yPos+$ySize)<=@mHeight)
for ($i=0;$i<$xSize;$i++)
ImageLine(@mImg, $xPos+$i, $yPos, $xPos+$i, $yPos+$ySize, @mBrush);
end
return true;
end
return false;
end
#
# Returns the current error message.
# @return string error message.
#
def GetError()
return @mError;
end
#
# Returns the font height.
# @param int $font font type.
# @return int font height.
#
def GetFontHeight($font)
return ImageFontHeight($font);
end
#
# Returns the font width.
# @param int $font font type.
# @return int font width.
#
def GetFontWidth($font)
return ImageFontWidth($font);
end
#
# Set font type.
# @param int $font font type.
#
def SetFont($font)
@mFont = $font;
end
#
# Returns barcode style.
# @return int barcode style.
#
def GetStyle()
return @mStyle;
end
#
# Set barcode style.
# @param int $Style barcode style.
#
def SetStyle ($Style)
@mStyle = $Style;
end
#
# Flush the barcode image.
#
def FlushObject()
if ((@mStyle & BCS_BORDER))
@DrawBorder();
end
if (@mStyle & BCS_IMAGE_PNG)
Header("Content-Type: image/png");
ImagePng(@mImg);
elsif (@mStyle & BCS_IMAGE_JPEG)
Header("Content-Type: image/jpeg");
ImageJpeg(@mImg);
end
end
#
# Destroy the barcode image.
#
def DestroyObject()
ImageDestroy(@mImg);
end
}
#============================================================+
# END OF FILE
#============================================================+
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#============================================================+
# File name : c39object.rb
# Begin : 2002-07-31
# Last Update : 2004-12-29
# Author : Karim Mribti [barcode@mribti.com]
# : Nicola Asuni [info@tecnick.com]
# Version : 0.0.8a 2001-04-01 (original code)
# License : GNU LGPL (Lesser General Public License) 2.1
# http://www.gnu.org/copyleft/lesser.txt
# Source Code : http://www.mribti.com/barcode/
#
# Description : Code 39 Barcode Render Class for PHP using
# the GD graphics library.
# Code 39 is an alphanumeric bar code that can
# encode decimal number, case alphabet and some
# special symbols.
#
# NOTE:
# This version contains changes by Nicola Asuni:
# - porting to Ruby
# - code style and formatting
# - automatic php documentation in PhpDocumentor Style
# (www.phpdoc.org)
# - minor bug fixing
#============================================================+
#
# Code 39 Barcode Render Class.<br>
# Code 39 is an alphanumeric bar code that can encode decimal number, case alphabet and some special symbols.
# @author Karim Mribti, Nicola Asuni
# @name BarcodeObject
# @package com.tecnick.tcpdf
# @@version 0.0.8a 2001-04-01 (original code)
# @since 2001-03-25
# @license http://www.gnu.org/copyleft/lesser.html LGPL
#
#
# Code 39 Barcode Render Class.<br>
# Code 39 is an alphanumeric bar code that can encode decimal number, case alphabet and some special symbols.
# @author Karim Mribti, Nicola Asuni
# @name BarcodeObject
# @package com.tecnick.tcpdf
# @@version 0.0.8a 2001-04-01 (original code)
# @since 2001-03-25
# @license http://www.gnu.org/copyleft/lesser.html LGPL
#
class C39Object extends BarcodeObject {
#
# Class Constructor.
# @param int $Width Image width in pixels.
# @param int $Height Image height in pixels.
# @param int $Style Barcode style.
# @param int $Value value to print on barcode.
#
def __construct($Width, $Height, $Style, $Value)
parent::__construct($Width, $Height, $Style);
@mValue = $Value;
@mChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-.#$/+%";
@mCharSet = array (
# 0 # "000110100",
# 1 # "100100001",
# 2 # "001100001",
# 3 # "101100000",
# 4 # "000110001",
# 5 # "100110000",
# 6 # "001110000",
# 7 # "000100101",
# 8 # "100100100",
# 9 # "001100100",
# A # "100001001",
# B # "001001001",
# C # "101001000",
# D # "000011001",
# E # "100011000",
# F # "001011000",
# G # "000001101",
# H # "100001100",
# I # "001001100",
# J # "000011100",
# K # "100000011",
# L # "001000011",
# M # "101000010",
# N # "000010011",
# O # "100010010",
# P # "001010010",
# Q # "000000111",
# R # "100000110",
# S # "001000110",
# T # "000010110",
# U # "110000001",
# V # "011000001",
# W # "111000000",
# X # "010010001",
# Y # "110010000",
# Z # "011010000",
# - # "010000101",
# . # "110000100",
# SP# "011000100",
/*# # "010010100",
# $ # "010101000",
# / # "010100010",
# + # "010001010",
# % # "000101010"
);
end
#
# Returns the character index.
# @param char $char character.
# @return int character index or -1 in case of error.
# @access private
#
def GetCharIndex($char)
for ($i=0;$i<44;$i++)
if (@mChars[$i] == $char)
return $i;
end
end
return -1;
end
#
# Returns barcode size.
# @param int $xres Horizontal resolution.
# @return barcode size.
# @access private
#
def GetSize($xres)
$len = @mValue.length;
if ($len == 0) {
@mError = "Null value";
return false;
end
for ($i=0;$i<$len;$i++)
if (GetCharIndex(@mValue[$i]) == -1 || @mValue[$i] == '*')
# The asterisk is only used as a start and stop code#
@mError = "C39 not include the char '".@mValue[$i]."'";
return false;
end
end
# Start, Stop is 010010100 == '*' #
$StartSize = BCD_C39_NARROW_BAR# $xres# 6 + BCD_C39_WIDE_BAR# $xres# 3;
$StopSize = BCD_C39_NARROW_BAR# $xres# 6 + BCD_C39_WIDE_BAR# $xres# 3;
$CharSize = BCD_C39_NARROW_BAR# $xres# 6 + BCD_C39_WIDE_BAR# $xres# 3; # Same for all chars#
return $CharSize# $len + $StartSize + $StopSize + # Space between chars# BCD_C39_NARROW_BAR# $xres# ($len-1);
end
#
# Draws the start code.
# @param int $DrawPos Drawing position.
# @param int $yPos Vertical position.
# @param int $ySize Vertical size.
# @param int $xres Horizontal resolution.
# @return int drawing position.
# @access private
#
def DrawStart($DrawPos, $yPos, $ySize, $xres)
# Start code is '*'#
$narrow = BCD_C39_NARROW_BAR# $xres;
$wide = BCD_C39_WIDE_BAR# $xres;
@DrawSingleBar($DrawPos, $yPos, $narrow , $ySize);
$DrawPos += $narrow;
$DrawPos += $wide;
@DrawSingleBar($DrawPos, $yPos, $narrow , $ySize);
$DrawPos += $narrow;
$DrawPos += $narrow;
@DrawSingleBar($DrawPos, $yPos, $wide , $ySize);
$DrawPos += $wide;
$DrawPos += $narrow;
@DrawSingleBar($DrawPos, $yPos, $wide , $ySize);
$DrawPos += $wide;
$DrawPos += $narrow;
@DrawSingleBar($DrawPos, $yPos, $narrow, $ySize);
$DrawPos += $narrow;
$DrawPos += $narrow; # Space between chars#
return $DrawPos;
end
#
# Draws the stop code.
# @param int $DrawPos Drawing position.
# @param int $yPos Vertical position.
# @param int $ySize Vertical size.
# @param int $xres Horizontal resolution.
# @return int drawing position.
# @access private
#
def DrawStop($DrawPos, $yPos, $ySize, $xres)
# Stop code is '*'#
$narrow = BCD_C39_NARROW_BAR# $xres;
$wide = BCD_C39_WIDE_BAR# $xres;
@DrawSingleBar($DrawPos, $yPos, $narrow , $ySize);
$DrawPos += $narrow;
$DrawPos += $wide;
@DrawSingleBar($DrawPos, $yPos, $narrow , $ySize);
$DrawPos += $narrow;
$DrawPos += $narrow;
@DrawSingleBar($DrawPos, $yPos, $wide , $ySize);
$DrawPos += $wide;
$DrawPos += $narrow;
@DrawSingleBar($DrawPos, $yPos, $wide , $ySize);
$DrawPos += $wide;
$DrawPos += $narrow;
@DrawSingleBar($DrawPos, $yPos, $narrow, $ySize);
$DrawPos += $narrow;
return $DrawPos;
end
#
# Draws the barcode object.
# @param int $xres Horizontal resolution.
# @return bool true in case of success.
#
def DrawObject($xres)
$len = @mValue.length;
$narrow = BCD_C39_NARROW_BAR# $xres;
$wide = BCD_C39_WIDE_BAR# $xres;
if (($size = GetSize($xres))==0)
return false;
end
$cPos = 0;
if (@mStyle & BCS_ALIGN_CENTER) $sPos = (integer)((@mWidth - $size ) / 2);
elsif (@mStyle & BCS_ALIGN_RIGHT) $sPos = @mWidth - $size;
else $sPos = 0;
# Total height of bar code -Bars only-#
if (@mStyle & BCS_DRAW_TEXT) $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2 - GetFontHeight(@mFont);
else $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2;
# Draw text#
if (@mStyle & BCS_DRAW_TEXT)
if (@mStyle & BCS_STRETCH_TEXT)
for ($i=0;$i<$len;$i++)
@DrawChar(@mFont, $sPos+($narrow*6+$wide*3)+($size/$len)*$i,
$ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue[$i]);
else# Center#
$text_width = GetFontWidth(@mFont)# @mValue.length;
@DrawText(@mFont, $sPos+(($size-$text_width)/2)+($narrow*6+$wide*3),
$ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue);
end
end
$DrawPos = @DrawStart($sPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres);
do {
$c = GetCharIndex(@mValue[$cPos]);
$cset = @mCharSet[$c];
@DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[0] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[0] == '0') ? $narrow : $wide;
$DrawPos += ($cset[1] == '0') ? $narrow : $wide;
@DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[2] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[2] == '0') ? $narrow : $wide;
$DrawPos += ($cset[3] == '0') ? $narrow : $wide;
@DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[4] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[4] == '0') ? $narrow : $wide;
$DrawPos += ($cset[5] == '0') ? $narrow : $wide;
@DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[6] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[6] == '0') ? $narrow : $wide;
$DrawPos += ($cset[7] == '0') ? $narrow : $wide;
@DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[8] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[8] == '0') ? $narrow : $wide;
$DrawPos += $narrow; # Space between chars#
$cPos += 1;
end while ($cPos<$len);
$DrawPos = @DrawStop($DrawPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres);
return true;
end
}
#============================================================+
# END OF FILE
#============================================================+
#============================================================+
# File name : i25aobject.rb
# Begin : 2002-07-31
# Last Update : 2004-12-29
# Author : Karim Mribti [barcode@mribti.com]
# : Nicola Asuni [info@tecnick.com]
# Version : 0.0.8a 2001-04-01 (original code)
# License : GNU LGPL (Lesser General Public License) 2.1
# http://www.gnu.org/copyleft/lesser.txt
# Source Code : http://www.mribti.com/barcode/
#
# Description : I25 Barcode Render Class for PHP using
# the GD graphics library.
# Interleaved 2 of 5 is a numeric only bar code
# with a optional check number.
#
# NOTE:
# This version contains changes by Nicola Asuni:
# - porting to Ruby
# - code style and formatting
# - automatic php documentation in PhpDocumentor Style
# (www.phpdoc.org)
# - minor bug fixing
#============================================================+
#
# I25 Barcode Render Class for PHP using the GD graphics library.<br<
# Interleaved 2 of 5 is a numeric only bar code with a optional check number.
# @author Karim Mribti, Nicola Asuni
# @name BarcodeObject
# @package com.tecnick.tcpdf
# @@version 0.0.8a 2001-04-01 (original code)
# @since 2001-03-25
# @license http://www.gnu.org/copyleft/lesser.html LGPL
#
#
# I25 Barcode Render Class for PHP using the GD graphics library.<br<
# Interleaved 2 of 5 is a numeric only bar code with a optional check number.
# @author Karim Mribti, Nicola Asuni
# @name BarcodeObject
# @package com.tecnick.tcpdf
# @@version 0.0.8a 2001-04-01 (original code)
# @since 2001-03-25
# @license http://www.gnu.org/copyleft/lesser.html LGPL
#
class I25Object extends BarcodeObject {
#
# Class Constructor.
# @param int $Width Image width in pixels.
# @param int $Height Image height in pixels.
# @param int $Style Barcode style.
# @param int $Value value to print on barcode.
#
def __construct($Width, $Height, $Style, $Value)
parent::__construct($Width, $Height, $Style);
@mValue = $Value;
@mCharSet = array (
# 0# "00110",
# 1# "10001",
# 2# "01001",
# 3# "11000",
# 4# "00101",
# 5# "10100",
# 6# "01100",
# 7# "00011",
# 8# "10010",
# 9# "01010"
);
end
#
# Returns barcode size.
# @param int $xres Horizontal resolution.
# @return barcode size.
# @access private
#
def GetSize($xres)
$len = @mValue.length;
if ($len == 0) {
@mError = "Null value";
return false;
end
for ($i=0;$i<$len;$i++)
if ((@mValue[$i][0] < 48) || (@mValue[$i][0] > 57))
@mError = "I25 is numeric only";
return false;
end
end
if (($len%2) != 0)
@mError = "The length of barcode value must be even";
return false;
end
$StartSize = BCD_I25_NARROW_BAR# 4 # $xres;
$StopSize = BCD_I25_WIDE_BAR# $xres + 2# BCD_I25_NARROW_BAR# $xres;
$cPos = 0;
$sPos = 0;
do {
$c1 = @mValue[$cPos];
$c2 = @mValue[$cPos+1];
$cset1 = @mCharSet[$c1];
$cset2 = @mCharSet[$c2];
for ($i=0;$i<5;$i++)
$type1 = ($cset1[$i]==0) ? (BCD_I25_NARROW_BAR # $xres) : (BCD_I25_WIDE_BAR# $xres);
$type2 = ($cset2[$i]==0) ? (BCD_I25_NARROW_BAR # $xres) : (BCD_I25_WIDE_BAR# $xres);
$sPos += ($type1 + $type2);
end
$cPos+=2;
end while ($cPos<$len);
return $sPos + $StartSize + $StopSize;
end
#
# Draws the start code.
# @param int $DrawPos Drawing position.
# @param int $yPos Vertical position.
# @param int $ySize Vertical size.
# @param int $xres Horizontal resolution.
# @return int drawing position.
# @access private
#
def DrawStart($DrawPos, $yPos, $ySize, $xres)
# Start code is "0000"#
@DrawSingleBar($DrawPos, $yPos, BCD_I25_NARROW_BAR # $xres , $ySize);
$DrawPos += BCD_I25_NARROW_BAR # $xres;
$DrawPos += BCD_I25_NARROW_BAR # $xres;
@DrawSingleBar($DrawPos, $yPos, BCD_I25_NARROW_BAR # $xres , $ySize);
$DrawPos += BCD_I25_NARROW_BAR # $xres;
$DrawPos += BCD_I25_NARROW_BAR # $xres;
return $DrawPos;
end
#
# Draws the stop code.
# @param int $DrawPos Drawing position.
# @param int $yPos Vertical position.
# @param int $ySize Vertical size.
# @param int $xres Horizontal resolution.
# @return int drawing position.
# @access private
#
def DrawStop($DrawPos, $yPos, $ySize, $xres)
# Stop code is "100"#
@DrawSingleBar($DrawPos, $yPos, BCD_I25_WIDE_BAR# $xres , $ySize);
$DrawPos += BCD_I25_WIDE_BAR # $xres;
$DrawPos += BCD_I25_NARROW_BAR # $xres;
@DrawSingleBar($DrawPos, $yPos, BCD_I25_NARROW_BAR # $xres , $ySize);
$DrawPos += BCD_I25_NARROW_BAR # $xres;
return $DrawPos;
end
#
# Draws the barcode object.
# @param int $xres Horizontal resolution.
# @return bool true in case of success.
#
def DrawObject($xres)
$len = @mValue.length;
if (($size = GetSize($xres))==0)
return false;
end
$cPos = 0;
if (@mStyle & BCS_DRAW_TEXT) $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2 - GetFontHeight(@mFont);
else $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2;
if (@mStyle & BCS_ALIGN_CENTER) $sPos = (integer)((@mWidth - $size ) / 2);
elsif (@mStyle & BCS_ALIGN_RIGHT) $sPos = @mWidth - $size;
else $sPos = 0;
if (@mStyle & BCS_DRAW_TEXT)
if (@mStyle & BCS_STRETCH_TEXT)
# Stretch#
for ($i=0;$i<$len;$i++)
@DrawChar(@mFont, $sPos+BCD_I25_NARROW_BAR*4*$xres+($size/$len)*$i,
$ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET , @mValue[$i]);
end
endelse# Center#
$text_width = GetFontWidth(@mFont) * @mValue.length;
@DrawText(@mFont, $sPos+(($size-$text_width)/2)+(BCD_I25_NARROW_BAR*4*$xres),
$ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue);
end
end
$sPos = @DrawStart($sPos, BCD_DEFAULT_MAR_Y1, $ysize, $xres);
do {
$c1 = @mValue[$cPos];
$c2 = @mValue[$cPos+1];
$cset1 = @mCharSet[$c1];
$cset2 = @mCharSet[$c2];
for ($i=0;$i<5;$i++)
$type1 = ($cset1[$i]==0) ? (BCD_I25_NARROW_BAR# $xres) : (BCD_I25_WIDE_BAR# $xres);
$type2 = ($cset2[$i]==0) ? (BCD_I25_NARROW_BAR# $xres) : (BCD_I25_WIDE_BAR# $xres);
@DrawSingleBar($sPos, BCD_DEFAULT_MAR_Y1, $type1 , $ysize);
$sPos += ($type1 + $type2);
end
$cPos+=2;
end while ($cPos<$len);
$sPos = @DrawStop($sPos, BCD_DEFAULT_MAR_Y1, $ysize, $xres);
return true;
end
}
#============================================================+
# END OF FILE
#============================================================+
#============================================================+
# File name : image.rb
# Begin : 2002-07-31
# Last Update : 2005-01-08
# Author : Karim Mribti [barcode@mribti.com]
# : Nicola Asuni [info@tecnick.com]
# Version : 0.0.8a 2001-04-01 (original code)
# License : GNU LGPL (Lesser General Public License) 2.1
# http://www.gnu.org/copyleft/lesser.txt
# Source Code : http://www.mribti.com/barcode/
#
# Description : Barcode Image Rendering.
#
# NOTE:
# This version contains changes by Nicola Asuni:
# - porting to Ruby
# - code style and formatting
# - automatic php documentation in PhpDocumentor Style
# (www.phpdoc.org)
# - minor bug fixing
#============================================================+
#
# Barcode Image Rendering.
# @author Karim Mribti, Nicola Asuni
# @name BarcodeObject
# @package com.tecnick.tcpdf
# @@version 0.0.8a 2001-04-01 (original code)
# @since 2001-03-25
# @license http://www.gnu.org/copyleft/lesser.html LGPL
#
#
#
#
require("../../shared/barcode/barcode.rb");
require("../../shared/barcode/i25object.rb");
require("../../shared/barcode/c39object.rb");
require("../../shared/barcode/c128aobject.rb");
require("../../shared/barcode/c128bobject.rb");
require("../../shared/barcode/c128cobject.rb");
if (!$_REQUEST['style'].nil?) $_REQUEST['style'] = BCD_DEFAULT_STYLE;
if (!$_REQUEST['width'].nil?) $_REQUEST['width'] = BCD_DEFAULT_WIDTH;
if (!$_REQUEST['height'].nil?) $_REQUEST['height'] = BCD_DEFAULT_HEIGHT;
if (!$_REQUEST['xres'].nil?) $_REQUEST['xres'] = BCD_DEFAULT_XRES;
if (!$_REQUEST['font'].nil?) $_REQUEST['font'] = BCD_DEFAULT_FONT;
if (!$_REQUEST['type'].nil?) $_REQUEST['type'] = "C39";
if (!$_REQUEST['code'].nil?) $_REQUEST['code'] = "";
switch ($_REQUEST['type'].upcase)
case "I25"
$obj = new I25Object($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
break;
end
case "C128A"
$obj = new C128AObject($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
break;
end
case "C128B"
$obj = new C128BObject($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
break;
end
case "C128C"
$obj = new C128CObject($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
break;
end
case "C39":
default
$obj = new C39Object($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
break;
end
}
if ($obj)
$obj->SetFont($_REQUEST['font']);
$obj->DrawObject($_REQUEST['xres']);
$obj->FlushObject();
$obj->DestroyObject();
unset($obj); # clean#
}
#============================================================+
# END OF FILE
#============================================================+
This diff is collapsed.
#============================================================+
# File name : eng.rb
# Begin : 2004-03-03
# Last Update : 2005-03-19
#
# Description : Language module for TCPDF
# (contains translated texts)
#
#
# Author: Nicola Asuni
#
# (c) Copyright:
# Tecnick.com S.r.l.
# Via Ugo Foscolo n.19
# 09045 Quartu Sant'Elena (CA)
# ITALY
# www.tecnick.com
# info@tecnick.com
#============================================================+
#
# TCPDF language file (contains translated texts).
# @package com.tecnick.tcpdf
# @abstract TCPDF language file.
# @author Nicola Asuni
# @copyright 2004 Tecnick.com S.r.l (www.tecnick.com) Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
# @link http://tcpdf.sourceforge.net
# @license http://www.gnu.org/copyleft/lesser.html LGPL
# @since 2004-03-03
#
# ENGLISH
@l = []
# PAGE META DESCRIPTORS --------------------------------------
@l['a_meta_charset'] = "UTF-8";
@l['a_meta_dir'] = "ltr";
@l['a_meta_language'] = "en";
# TRANSLATIONS --------------------------------------
@l['w_page'] = "page";
#============================================================+
# END OF FILE
#============================================================+
# Copyright (c) 2006 4ssoM LLC <www.4ssoM.com>
#
# The MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
......@@ -20,66 +18,47 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# Thanks go out to Bruce Williams of codefluency who created RTex. This
# template handler is modification of his work.
#
# Example Registration
#
# ActionView::Base::register_template_handler 'rfpdf', RFpdfView
# This implements native php methods used by tcpdf, which have had to be
# reimplemented within Ruby.
module RFPDF
class View
@@backward_compatibility_mode = false
cattr_accessor :backward_compatibility_mode
def initialize(action_view)
@action_view = action_view
# Override with @options_for_rfpdf Hash in your controller
@options = {
# Run through latex first? (for table of contents, etc)
:pre_process => false,
# Debugging mode; raises exception
:debug => false,
# Filename of pdf to generate
:file_name => "#{@action_view.controller.action_name}.pdf",
# Temporary Directory
:temp_dir => "#{File.expand_path(RAILS_ROOT)}/tmp"
}.merge(@action_view.controller.instance_eval{ @options_for_rfpdf } || {}).with_indifferent_access
end
def self.compilable?
false
end
def compilable?
self.class.compilable?
end
def render(template, local_assigns = {})
@pdf_name = "Default.pdf" if @pdf_name.nil?
unless @action_view.controller.headers["Content-Type"] == 'application/pdf'
@generate = true
@action_view.controller.headers["Content-Type"] = 'application/pdf'
@action_view.controller.headers["Content-disposition:"] = "inline; filename=\"#{@options[:file_name]}\""
end
assigns = @action_view.assigns.dup
# http://uk2.php.net/getimagesize
def getimagesize(filename)
out = Hash.new
out[2] = ImageScience.image_type(filename)
if content_for_layout = @action_view.instance_variable_get("@content_for_layout")
assigns['content_for_layout'] = content_for_layout
image = ImageScience.with_image(filename) do |img|
out[0] = image.width
out[1] = image.height
# These are actually meant to return integer values But I couldn't seem to find anything saying what those values are.
# So for now they return strings. The only place that uses this at the moment is the parsejpeg method, so I've changed that too.
case out[2]
when "GIF"
out['mime'] = "image/gif"
when "JPEG"
out['mime'] = "image/jpeg"
when "PNG"
out['mime'] = "image/png"
when "WBMP"
out['mime'] = "image/vnd.wap.wbmp"
when "XPM"
out['mime'] = "image/x-xpixmap"
end
result = @action_view.instance_eval do
assigns.each do |key,val|
instance_variable_set "@#{key}", val
end
local_assigns.each do |key,val|
class << self; self; end.send(:define_method,key){ val }
end
ERB.new(@@backward_compatibility_mode == true ? template : template.source).result(binding)
out[3] = "height=\"#{image.height}\" width=\"#{image.width}\""
if image.colorspace == "CMYK" || image.colorspace == "RGBA"
out['channels'] = 4
elsif image.colorspace == "RGB"
out['channels'] = 3
end
out['bits'] = image.depth
out['bits'] /= out['channels'] if out['channels']
end
out
end
end
\ No newline at end of file
# The MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# This implements native php methods used by tcpdf, which have had to be
# reimplemented within Ruby.
module RFPDF
# http://uk2.php.net/getimagesize
def getimagesize(filename)
image = Magick::ImageList.new(filename)
out = Hash.new
out[0] = image.columns
out[1] = image.rows
# These are actually meant to return integer values But I couldn't seem to find anything saying what those values are.
# So for now they return strings. The only place that uses this at the moment is the parsejpeg method, so I've changed that too.
case image.mime_type
when "image/gif"
out[2] = "GIF"
when "image/jpeg"
out[2] = "JPEG"
when "image/png"
out[2] = "PNG"
when " image/vnd.wap.wbmp"
out[2] = "WBMP"
when "image/x-xpixmap"
out[2] = "XPM"
end
out[3] = "height=\"#{image.rows}\" width=\"#{image.columns}\""
out['mime'] = image.mime_type
# This needs work to cover more situations
# I can't see how to just list the number of channels with ImageMagick / rmagick
if image.colorspace.to_s == "CMYKColorspace"
out['channels'] = 4
elsif image.colorspace.to_s == "RGBColorspace"
out['channels'] = 3
end
out['bits'] = image.channel_depth
out
end
end
\ No newline at end of file
This folder contains fonts descriptions for TCPDF.
Please read the documentation on subfolders for copyright, license and other information.
\ No newline at end of file
TCPDFFontDescriptor.define('courier') do |font|
font[:cw] = {}
0.upto(255) do |i|
font[:cw][i]=600
end
end
TCPDFFontDescriptor.define('courierb') do |font|
font[:cw] = {}
0.upto(255) do |i|
font[:cw][i]=600
end
end
TCPDFFontDescriptor.define('courierbi') do |font|
font[:cw] = {}
0.upto(255) do |i|
font[:cw][i]=600
end
end
TCPDFFontDescriptor.define('courieri') do |font|
font[:cw] = {}
0.upto(255) do |i|
font[:cw][i]=600
end
end
Adrian Schroeter
Andrey Valentinovich Panov
Ben Laenen
Bhikkhu Pesala
Clayborne Arevalo
Dafydd Harries
Danilo Segan
Davide Viti
David Jez
David Lawrence Ramsey
Denis Jacquerye
Dwayne Bailey
Eugeniy Meshcheryakov
Gee Fung Sit
Heikki Lindroos
James Cloos
James Crippen
John Karp
Keenan Pepper
Lars Naesbye Christensen
Mashrab Kuvatov
Mederic Boquien
Michael Everson
Misu Moldovan
Nguyen Thai Ngoc Duy
Ognyan Kulev
Ondrej Koala Vacha
Peter Cernak
Remy Oudompheng
Roozbeh Pournader
Sander Vesik
Stepan Roh
Tavmjong Bah
Tim May
Valentin Stoykov
Vasek Stodulka
$Id: AUTHORS 1491 2007-01-12 20:40:12Z ben_laenen $
See http://dejavu.sourceforge.net/wiki/index.rb/Bugs
$Id: BUGS 80 2004-11-13 13:12:02Z src $
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below)
Bitstream Vera Fonts Copyright
------------------------------
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute the
Font Software, including without limitation the rights to use, copy, merge,
publish, distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to the
following conditions:
The above copyright and trademark notices and this permission notice shall
be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular
the designs of glyphs or characters in the Fonts may be modified and
additional glyphs or characters may be added to the Fonts, only if the fonts
are renamed to names not containing either the words "Bitstream" or the word
"Vera".
This License becomes null and void to the extent applicable to Fonts or Font
Software that has been modified and is distributed under the "Bitstream
Vera" names.
The Font Software may be sold as part of a larger software package but no
copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font Software
without prior written authorization from the Gnome Foundation or Bitstream
Inc., respectively. For further information, contact: fonts at gnome dot
org.
Arev Fonts Copyright
------------------------------
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and
associated documentation files (the "Font Software"), to reproduce
and distribute the modifications to the Bitstream Vera Font Software,
including without limitation the rights to use, copy, merge, publish,
distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to
the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Tavmjong Bah" or the word "Arev".
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Tavmjong Bah Arev" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the name of Tavmjong Bah shall not
be used in advertising or otherwise to promote the sale, use or other
dealings in this Font Software without prior written authorization
from Tavmjong Bah. For further information, contact: tavmjong @ free
. fr.
$Id: LICENSE 778 2006-04-20 18:14:24Z moyogo $
This diff is collapsed.
DejaVu fonts 2.15 (c)2004-2007 DejaVu fonts team
-----------------------------------------------
The DejaVu fonts are a font family based on the Bitstream Vera Fonts
(http://gnome.org/fonts/). Its purpose is to provide a wider range of
characters (see status.txt for more information) while maintaining the
original look and feel.
DejaVu fonts are based on Bitstream Vera fonts version 1.10.
Available fonts (Sans = sans serif, Mono = monospaced):
DejaVu Sans Mono
DejaVu Sans Mono Bold
DejaVu Sans Mono Bold Oblique
DejaVu Sans Mono Oblique
DejaVu Sans
DejaVu Sans Bold
DejaVu Sans Bold Oblique
DejaVu Sans Oblique
DejaVu Sans ExtraLight (experimental)
DejaVu Serif
DejaVu Serif Bold
DejaVu Serif Bold Oblique (experimental)
DejaVu Serif Oblique (experimental)
DejaVu Sans Condensed (experimental)
DejaVu Sans Condensed Bold (experimental)
DejaVu Sans Condensed Bold Oblique (experimental)
DejaVu Sans Condensed Oblique (experimental)
DejaVu Serif Condensed (experimental)
DejaVu Serif Condensed Bold (experimental)
DejaVu Serif Condensed Bold Oblique (experimental)
DejaVu Serif Condensed Oblique (experimental)
All fonts are also available as derivative called DejaVu LGC with support
only for Latin, Greek and Cyrillic scripts.
For license information see LICENSE. What's new is described in NEWS. Known
bugs are in BUGS. All authors are mentioned in AUTHORS.
Fonts are published in source form as SFD files (Spline Font Database from
FontForge - http://fontforge.sf.net/) and in compiled form as TTF files
(TrueType fonts).
For more information go to http://dejavu.sourceforge.net/.
Characters from Arev fonts, Copyright (c) 2006 by Tavmjong Bah:
---------------------------
U+01ba, U+01bf, U+01f7, U+021c, U+021d, U+0220, U+0222, U+0223,
U+02b9, U+02ba, U+02bd, U+02c2, U+02c3, U+02c4, U+02c5, U+02d4,
U+02d5, U+02d7, U+02ec, U+02ed, U+02ee, U+0346-034e, U+0360, U+0362,
U+03e2-03ef, U+0460-0463, U+0466-0486, U+0488-0489, U+04a8-04a9,
U+0500-050f, U+2055-205e, U+20B0, U+20B2-20B3, U+2102, U+210D, U+210f,
U+2111, U+2113, U+2115, U+2118-U+211A, U+211c-211d, U+2124,U+2135,
U+213C-U+2140, U+2295-2298, U+2308-230b, U+26A2-U+26B1, U+2701-2704,
U+2706-2709, U+270c-274b, U+2758-275a, U+2761-2775, U+2780-2794,
U+2798-27af, U+27b1-27be, U+fb05-fb06
$Id: README 1587 2007-02-18 16:20:38Z ben_laenen $
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
-*-mode:text;-*-
$Id: INSTALL,v 1.1 2002/12/12 15:09:05 peterlin Exp $
Installing the Free UCS outline fonts
=====================================
These installation notes are supposed to provide a helpful guidance
through the process of installation of free UCS outline fonts. They
can probably be significantly improved. Please direct your comments,
suggestions for improvements, criticisms etc. to Primoz PETERLIN
<primoz.peterlin@biofiz.mf.uni-lj.si> and thus help improve them.
1. UNIX/GNU/Linux/BSD Systems
The rather awkward "UNIX/GNU/Linux/BSD" agglomeration is used to
denote any system capable of running XFree86 server with FreeType
<http://www.freetype.org/>, a high-quality free font rasterizer.
1.1 The rough way
Unfortunately, hardly any other way exists at the moment.
1) Fetch the freefont-ttf.tar.gz package with Free UCS outline fonts
in the TrueType format.
2) Unpack TrueType fonts into a suitable directory,
e.g. /usr/share/fonts/default/TrueType/.
3) If you have chosen any other directory, make sure the directory you
used to install the fonts is listed in the path searched by the X
Font Server. Append the directory to the "catalogue=" in the
/etc/X11/fs/config.
4) Run ttmkfdir in the directory where you unpacked the fonts.
1.2 Debian GNU/Linux
Users of Debian GNU/Linux system will probably want to use the
pre-packed Debian package, as available from the Debian site,
<http://packages.debian.org/unstable/x11/ttf-freefont.html>, or
any of its mirrors. You can install them by issuing the command
apt-get install ttf-freefont
2. Microsoft Windows 95/98/NT/2000/XP
To be written.
3. MacOS
To be written.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
TCPDFFontDescriptor.define('helvetica') do |font|
font[:cw]={
0.chr=>278, 1.chr=>278, 2.chr=>278, 3.chr=>278, 4.chr=>278, 5.chr=>278, 6.chr=>278, 7.chr=>278, 8.chr=>278, 9.chr=>278, 10.chr=>278, 11.chr=>278, 12.chr=>278, 13.chr=>278, 14.chr=>278, 15.chr=>278, 16.chr=>278, 17.chr=>278, 18.chr=>278, 19.chr=>278, 20.chr=>278, 21.chr=>278, 22.chr=>278, 23.chr=>278, 24.chr=>278, 25.chr=>278, 26.chr=>278, 27.chr=>278, 28.chr=>278, 29.chr=>278, 30.chr=>278, 31.chr=>278, ' '=>278, '!'=>278, '"'=>355, '#'=>556, '$'=>556, '%'=>889, '&'=>667, '\''=>191, '('=>333, ')'=>333, '*'=>389, '+'=>584, ','=>278, '-'=>333, '.'=>278, '/'=>278, '0'=>556, '1'=>556, '2'=>556, '3'=>556, '4'=>556, '5'=>556, '6'=>556, '7'=>556, '8'=>556, '9'=>556, ':'=>278, ';'=>278, '<'=>584, '='=>584, '>'=>584, '?'=>556, '@'=>1015, 'A'=>667, 'B'=>667, 'C'=>722, 'D'=>722, 'E'=>667, 'F'=>611, 'G'=>778, 'H'=>722, 'I'=>278, 'J'=>500, 'K'=>667, 'L'=>556, 'M'=>833, 'N'=>722, 'O'=>778, 'P'=>667, 'Q'=>778, 'R'=>722, 'S'=>667, 'T'=>611, 'U'=>722, 'V'=>667, 'W'=>944, 'X'=>667, 'Y'=>667, 'Z'=>611, '['=>278, '\\'=>278, ']'=>278, '^'=>469, '_'=>556, '`'=>333, 'a'=>556, 'b'=>556, 'c'=>500, 'd'=>556, 'e'=>556, 'f'=>278, 'g'=>556, 'h'=>556, 'i'=>222, 'j'=>222, 'k'=>500, 'l'=>222, 'm'=>833, 'n'=>556, 'o'=>556, 'p'=>556, 'q'=>556, 'r'=>333, 's'=>500, 't'=>278, 'u'=>556, 'v'=>500, 'w'=>722, 'x'=>500, 'y'=>500, 'z'=>500, '{'=>334, '|'=>260, '}'=>334, '~'=>584, 127.chr=>350, 128.chr=>556, 129.chr=>350, 130.chr=>222, 131.chr=>556, 132.chr=>333, 133.chr=>1000, 134.chr=>556, 135.chr=>556, 136.chr=>333, 137.chr=>1000, 138.chr=>667, 139.chr=>333, 140.chr=>1000, 141.chr=>350, 142.chr=>611, 143.chr=>350, 144.chr=>350, 145.chr=>222, 146.chr=>222, 147.chr=>333, 148.chr=>333, 149.chr=>350, 150.chr=>556, 151.chr=>1000, 152.chr=>333, 153.chr=>1000, 154.chr=>500, 155.chr=>333, 156.chr=>944, 157.chr=>350, 158.chr=>500, 159.chr=>667, 160.chr=>278, 161.chr=>333, 162.chr=>556, 163.chr=>556, 164.chr=>556, 165.chr=>556, 166.chr=>260, 167.chr=>556, 168.chr=>333, 169.chr=>737, 170.chr=>370, 171.chr=>556, 172.chr=>584, 173.chr=>333, 174.chr=>737, 175.chr=>333, 176.chr=>400, 177.chr=>584, 178.chr=>333, 179.chr=>333, 180.chr=>333, 181.chr=>556, 182.chr=>537, 183.chr=>278, 184.chr=>333, 185.chr=>333, 186.chr=>365, 187.chr=>556, 188.chr=>834, 189.chr=>834, 190.chr=>834, 191.chr=>611, 192.chr=>667, 193.chr=>667, 194.chr=>667, 195.chr=>667, 196.chr=>667, 197.chr=>667, 198.chr=>1000, 199.chr=>722, 200.chr=>667, 201.chr=>667, 202.chr=>667, 203.chr=>667, 204.chr=>278, 205.chr=>278, 206.chr=>278, 207.chr=>278, 208.chr=>722, 209.chr=>722, 210.chr=>778, 211.chr=>778, 212.chr=>778, 213.chr=>778, 214.chr=>778, 215.chr=>584, 216.chr=>778, 217.chr=>722, 218.chr=>722, 219.chr=>722, 220.chr=>722, 221.chr=>667, 222.chr=>667, 223.chr=>611, 224.chr=>556, 225.chr=>556, 226.chr=>556, 227.chr=>556, 228.chr=>556, 229.chr=>556, 230.chr=>889, 231.chr=>500, 232.chr=>556, 233.chr=>556, 234.chr=>556, 235.chr=>556, 236.chr=>278, 237.chr=>278, 238.chr=>278, 239.chr=>278, 240.chr=>556, 241.chr=>556, 242.chr=>556, 243.chr=>556, 244.chr=>556, 245.chr=>556, 246.chr=>556, 247.chr=>584, 248.chr=>611, 249.chr=>556, 250.chr=>556, 251.chr=>556, 252.chr=>556, 253.chr=>500, 254.chr=>556, 255.chr=>500}
end
\ No newline at end of file
TCPDFFontDescriptor.define('helveticab') do |font|
font[:cw]={
0.chr=>278,1.chr=>278,2.chr=>278,3.chr=>278,4.chr=>278,5.chr=>278,6.chr=>278,7.chr=>278,8.chr=>278,9.chr=>278,10.chr=>278,11.chr=>278,12.chr=>278,13.chr=>278,14.chr=>278,15.chr=>278,16.chr=>278,17.chr=>278,18.chr=>278,19.chr=>278,20.chr=>278,21.chr=>278,
22.chr=>278,23.chr=>278,24.chr=>278,25.chr=>278,26.chr=>278,27.chr=>278,28.chr=>278,29.chr=>278,30.chr=>278,31.chr=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,127.chr=>350,128.chr=>556,129.chr=>350,130.chr=>278,131.chr=>556,
132.chr=>500,133.chr=>1000,134.chr=>556,135.chr=>556,136.chr=>333,137.chr=>1000,138.chr=>667,139.chr=>333,140.chr=>1000,141.chr=>350,142.chr=>611,143.chr=>350,144.chr=>350,145.chr=>278,146.chr=>278,147.chr=>500,148.chr=>500,149.chr=>350,150.chr=>556,151.chr=>1000,152.chr=>333,153.chr=>1000,
154.chr=>556,155.chr=>333,156.chr=>944,157.chr=>350,158.chr=>500,159.chr=>667,160.chr=>278,161.chr=>333,162.chr=>556,163.chr=>556,164.chr=>556,165.chr=>556,166.chr=>280,167.chr=>556,168.chr=>333,169.chr=>737,170.chr=>370,171.chr=>556,172.chr=>584,173.chr=>333,174.chr=>737,175.chr=>333,
176.chr=>400,177.chr=>584,178.chr=>333,179.chr=>333,180.chr=>333,181.chr=>611,182.chr=>556,183.chr=>278,184.chr=>333,185.chr=>333,186.chr=>365,187.chr=>556,188.chr=>834,189.chr=>834,190.chr=>834,191.chr=>611,192.chr=>722,193.chr=>722,194.chr=>722,195.chr=>722,196.chr=>722,197.chr=>722,
198.chr=>1000,199.chr=>722,200.chr=>667,201.chr=>667,202.chr=>667,203.chr=>667,204.chr=>278,205.chr=>278,206.chr=>278,207.chr=>278,208.chr=>722,209.chr=>722,210.chr=>778,211.chr=>778,212.chr=>778,213.chr=>778,214.chr=>778,215.chr=>584,216.chr=>778,217.chr=>722,218.chr=>722,219.chr=>722,
220.chr=>722,221.chr=>667,222.chr=>667,223.chr=>611,224.chr=>556,225.chr=>556,226.chr=>556,227.chr=>556,228.chr=>556,229.chr=>556,230.chr=>889,231.chr=>556,232.chr=>556,233.chr=>556,234.chr=>556,235.chr=>556,236.chr=>278,237.chr=>278,238.chr=>278,239.chr=>278,240.chr=>611,241.chr=>611,
242.chr=>611,243.chr=>611,244.chr=>611,245.chr=>611,246.chr=>611,247.chr=>584,248.chr=>611,249.chr=>611,250.chr=>611,251.chr=>611,252.chr=>611,253.chr=>556,254.chr=>611,255.chr=>556}
end
\ No newline at end of file
TCPDFFontDescriptor.define('helveticabi') do |font|
font[:cw]={
0.chr=>278,1.chr=>278,2.chr=>278,3.chr=>278,4.chr=>278,5.chr=>278,6.chr=>278,7.chr=>278,8.chr=>278,9.chr=>278,10.chr=>278,11.chr=>278,12.chr=>278,13.chr=>278,14.chr=>278,15.chr=>278,16.chr=>278,17.chr=>278,18.chr=>278,19.chr=>278,20.chr=>278,21.chr=>278,
22.chr=>278,23.chr=>278,24.chr=>278,25.chr=>278,26.chr=>278,27.chr=>278,28.chr=>278,29.chr=>278,30.chr=>278,31.chr=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,127.chr=>350,128.chr=>556,129.chr=>350,130.chr=>278,131.chr=>556,
132.chr=>500,133.chr=>1000,134.chr=>556,135.chr=>556,136.chr=>333,137.chr=>1000,138.chr=>667,139.chr=>333,140.chr=>1000,141.chr=>350,142.chr=>611,143.chr=>350,144.chr=>350,145.chr=>278,146.chr=>278,147.chr=>500,148.chr=>500,149.chr=>350,150.chr=>556,151.chr=>1000,152.chr=>333,153.chr=>1000,
154.chr=>556,155.chr=>333,156.chr=>944,157.chr=>350,158.chr=>500,159.chr=>667,160.chr=>278,161.chr=>333,162.chr=>556,163.chr=>556,164.chr=>556,165.chr=>556,166.chr=>280,167.chr=>556,168.chr=>333,169.chr=>737,170.chr=>370,171.chr=>556,172.chr=>584,173.chr=>333,174.chr=>737,175.chr=>333,
176.chr=>400,177.chr=>584,178.chr=>333,179.chr=>333,180.chr=>333,181.chr=>611,182.chr=>556,183.chr=>278,184.chr=>333,185.chr=>333,186.chr=>365,187.chr=>556,188.chr=>834,189.chr=>834,190.chr=>834,191.chr=>611,192.chr=>722,193.chr=>722,194.chr=>722,195.chr=>722,196.chr=>722,197.chr=>722,
198.chr=>1000,199.chr=>722,200.chr=>667,201.chr=>667,202.chr=>667,203.chr=>667,204.chr=>278,205.chr=>278,206.chr=>278,207.chr=>278,208.chr=>722,209.chr=>722,210.chr=>778,211.chr=>778,212.chr=>778,213.chr=>778,214.chr=>778,215.chr=>584,216.chr=>778,217.chr=>722,218.chr=>722,219.chr=>722,
220.chr=>722,221.chr=>667,222.chr=>667,223.chr=>611,224.chr=>556,225.chr=>556,226.chr=>556,227.chr=>556,228.chr=>556,229.chr=>556,230.chr=>889,231.chr=>556,232.chr=>556,233.chr=>556,234.chr=>556,235.chr=>556,236.chr=>278,237.chr=>278,238.chr=>278,239.chr=>278,240.chr=>611,241.chr=>611,
242.chr=>611,243.chr=>611,244.chr=>611,245.chr=>611,246.chr=>611,247.chr=>584,248.chr=>611,249.chr=>611,250.chr=>611,251.chr=>611,252.chr=>611,253.chr=>556,254.chr=>611,255.chr=>556}
end
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Contained herin is the Bitstream Vera font family.
The Copyright information is found in the COPYRIGHT.TXT file (along
with being incoporated into the fonts themselves).
The releases notes are found in the file "RELEASENOTES.TXT".
We hope you enjoy Vera!
Bitstream, Inc.
The Gnome Project
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment