|
NAMEPDF::Builder::Resource::Font::CoreFont - Module for using the 14 standard PDF built-in Fonts (plus 15 Windows Fonts) Inherits from PDF::Builder::Resource::Font SYNOPSIS #
use PDF::Builder;
#
my $pdf = PDF::Builder->new();
my $cft = $pdf->font('Times-Roman');
#my $cft = $pdf->corefont('Times-Roman');
#
my $page = $pdf->page();
my $text = $page->text();
$text->font($cft, 20);
$text->translate(200, 700);
$text->text("Hello, World!");
METHODSnew$font = PDF::Builder::Resource::Font::CoreFont->new($pdf, $fontname, %options) Returns a corefont object.
Supported typefacesStandard PDF types See examples/020_corefonts for a list of each font's glyphs.
Primarily Windows typefaces See examples/022_truefonts /Windows/Fonts/<name>.ttf for a list of each font's glyphs.
Keep in mind that only font metrics (widths) are provided with PDF::Builder; the fonts themselves are provided by the reader's machine (often packaged with the operating system, or obtained separately by the user). To use a specific font may require you to obtain one or more files from some source. If a font (typeface and variant) is not available on a given reader's machine, a substitution may be automatically made. For example, Helvetica is usually not shipped with Windows machines, and Arial might be substituted. For most characters, the glyph widths will be the same, but this can not be guaranteed! PDF::Builder currently uses the [typeface].pm files to map glyph names to code points (single byte encodings only) and to look up the glyph widths for character positioning. There is no guarantee that a given font file includes all the desired glyphs, nor that the widths will be absolutely the same, even in different releases of the same font. Options
is_standard$bool = $class->is_standard($name) Returns true if $name is an
exact, case-sensitive match for one of the standard font names shown
above.
loadallfontsPDF::Builder::Resource::Font::CoreFont->loadallfonts() "Requires in" all fonts available as
corefonts.
AUTHORAlfred Reibenschuh
|