PDF::API2::CoreFont

PDF::API2::CoreFont - a perl-module providing core-font objects for both Text::PDF and PDF::API2.

SYNOPSIS


	use PDF::API2;
	use PDF::API2::CoreFont;
	

	$api = PDF::API2->new;
	...
	$font = PDF::API2::CoreFont->new_api($api,'Helvetica', -encode => 'latin1'); 

OR


	use PDF::API2::PDF::File;
	use PDF::API2::CoreFont;
	

	$pdf = PDF::API2::PDF::File->new('some.pdf');
	...
	$font = PDF::API2::CoreFont->new($pdf,'Helvetica', -encode => 'latin1', -pdfname => 'F0'); 

METHODS

        $font = PDF::API2::CoreFont->new $pdf, $fontname, %options
                

Returns a corefont object.

Valid %options are:


	'-encode' ... changes the encoding of the font from its default.


	'-pdfname' ... changes the reference-name of the font from its default.

On '-encode': The natively supported encodings are 'latin1','winansi' and 'macroman'. Other Encodings are supported via PDF::API2::UniMap.

On '-pdfname': The reference-name is normally generated automatically and can be retrived via $pdfname=$font->name.

        $font = PDF::API2::CoreFont->new_api $api, $fontname, %options
                

Returns a corefont object. This method is different from 'new' that it needs an PDF::API2-object rather than a PDF::API2::PDF::File-object.

        PDF::API2::CoreFont->loadallfonts()
                

"Requires in" all fonts available as corefonts.

        $pdfstring = $font->text $text
                

Returns a properly formated string-representation of $text for use in the PDF.

        $pdfstring = $font->text_hex $text
                

Returns a properly formated hex-representation of $text for use in the PDF.

        $wd = $font->width $text
                

Returns the width of $text as if it were at size 1.

        @widths = $font->width_array $text
                

Returns the widths of the words in $text as if they were at size 1.

        $pdfname = $font->name
                

Returns the fonts pdfname.

        $a = $font->ascent
                

Returns the fonts ascender value.

        $d = $font->descent
                

Returns the fonts descender value.

        $ia = $font->italicangle
                

Returns the fonts italicangle value.

        ($llx,$lly,$urx,$ury) = $font->fontbbox
                

Returns the fonts bounding-box.

        $ch = $font->capheight
                

Returns the fonts capheight value.

        $xh = $font->xheight
                

Returns the fonts xheight.

        $ul = $font->underlineposition
                

Returns the fonts underlineposition.

SUPPORTED FONTS

        PDF::API::CoreFont supports the following 'Adobe Core Fonts':
                

	Courier 
	Courier-Bold
	Courier-BoldOblique
	Courier-Oblique
	Helvetica 
	Helvetica-Bold
	Helvetica-BoldOblique
	Helvetica-Oblique
	Symbol 
	Times-Bold
	Times-BoldItalic
	Times-Italic
	Times-Roman 
	ZapfDingbats

        PDF::API::CoreFont supports the following 'Windows Fonts':
                

	Arial
	Arial,Bold
	Arial,BoldItalic
	Arial,Italic
	BankGothic
	BankGothic,Bold
	BankGothic,BoldItalic
	BankGothic,Italic
	CourierNew
	CourierNew,Bold
	CourierNew,BoldItalic
	CourierNew,Italic
	Georgia
	Georgia,Bold
	Georgia,BoldItalic
	Georgia,Italic
	Impact
	Impact,Italic
	OzHandicraft
	OzHandicraft,Bold
	OzHandicraft,BoldItalic
	OzHandicraft,Italic
	TimesNewRoman
	TimesNewRoman,Bold
	TimesNewRoman,BoldItalic
	TimesNewRoman,Italic
	Trebuchet
	Trebuchet,Bold
	Trebuchet,BoldItalic
	Trebuchet,Italic
	Verdana
	Verdana,Bold
	Verdana,BoldItalic
	Verdana,Italic
	Webdings
	Wingdings

        PDF::API::CoreFont supports the following 'Unix-ish Fonts' as aliases:
                

	sans
	sans,bold
	sans,bolditalic
	sans,italic
	serif
	serif,bold
	serif,bolditalic
	serif,italic
	typewriter
	typewriter,bold
	typewriter,bolditalic
	typewriter,italic
	greek
	bats

AUTHOR

alfred reibenschuh