CTS logo
hazy blue Catskill Mountains in distance

News:

PDF::Builder v3.028 Released, 31 December 2025
   Please also see the CPAN listing, the GitHub entry, and the latest changes list.


A Thought…

There is more stupidity than hydrogen in the universe, and it has a longer shelf life.

   — Frank Zappa

NAME

PDF::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!");

METHODS

new

    $font = PDF::Builder::Resource::Font::CoreFont->new($pdf, $fontname, %options)

Returns a corefont object.

Supported typefaces

Standard PDF types

See examples/020_corefonts for a list of each font's glyphs.

  • Helvetica, Helvetica-Oblique, Helvetica-Bold, Helvetia-BoldOblique

    Sans-serif, may have Arial substituted on some systems (e.g., Windows).

  • Courier, Courier-Oblique, Courier-Bold, Courier-BoldOblique

    Fixed pitch, may have Courier New substituted on some systems (e.g., Windows).

  • Times-Roman, Times-Italic, Times-Bold, Times-BoldItalic

    Serif, may have Times New Roman substituted on some systems (e.g., Windows).

  • Symbol, ZapfDingbats

    Various symbols, including the Greek alphabet (in Symbol).

Primarily Windows typefaces

See examples/022_truefonts /Windows/Fonts/<name>.ttf for a list of each font's glyphs. examples/020_corefonts can also be used.

  • Georgia, Georgia-Italic, Georgia-Bold, Georgia-BoldItalic

    Serif proportional.

  • Trebuchet, Trebuchet-Italic, Trebuchet-Bold, Trebuchet-BoldItalic

    Sans-serif proportional with simple strokes.

  • Verdana, Verdana-Italic, Verdana-Bold, Verdana-BoldItalic

    Sans-serif proportional with simple strokes.

  • BankGothic, BankGothic-Italic, BankGothic-Bold, BankGothic-BoldItalic

    Sans-serif proportional with simple strokes. Free versions of Bank Gothic are often only medium weight Roman (BankGothic), and this is all that usually comes with Windows.

  • Webdings, Wingdings

    Various symbols, in the vein of Zapf Dingbats.

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

encode

Changes the encoding of the font from its default. Notice that the encoding (not the entire font's glyph list) is shown in a PDF object (record), listing 256 glyphs associated with this encoding (and that are available in this font).

See Perl's Encode for the supported values. Warning: only single byte encodings are permitted. Multibyte encodings such as 'utf8' are forbidden.

dokern

Enables kerning if data is available.

kerning is an older name for this option, and is still available as an alternative to dokern.

pdfname

Changes the reference-name of the font from its default. The reference-name is normally generated automatically and can be retrieved via $pdfname=$font->name().

metrics

If given, it is expected to be an anonymous hash of font file data. This is to be used instead of looking up the $fontname.pm file for width and other data. You may need to use this option if your installed font happens to be out of sync with the PDF::Builder built-in core font metrics file (e.g., helveticabold.pm).

is_standard

    $bool = $class->is_standard($name)

    $bool = $class->is_standard($name, $win_flag)

Returns true if $name is an exact, case-sensitive match for one of the standard font names shown above. If $win_flag is given, and is true (1), check against not only the basic 14 fonts, but also against the additional 15 Windows core font extensions.

names

    my @font_names = PDF::Builder::Resource::Font::CoreFont->names($flag);

    my $array_ref  = PDF::Builder::Resource::Font::CoreFont->names($flag);

Returns an array or a reference to an array containing the names of the built-in core (standard) fonts.

If called with an optional $flag of "true" value (1), the additional 15 Windows core fonts are included.

loadallfonts

    PDF::Builder::Resource::Font::CoreFont->loadallfonts($flag)

"Requires in" all fonts available as corefonts, including Windows extensions if the optional $flag is given and is "true" (1).

Warning: "dies" if any requested font is not found!

AUTHOR

Alfred Reibenschuh

NAVIGATION LINKS

Up (Parents)

Master Index
PDF::Builder -- Facilitates the creation and modification of PDF files
PDF::Builder::Resource -- Base class for PDF resources
PDF::Builder::Resource::Font -- Some common support routines for font files

Siblings

PDF::Builder::Resource::Font::BdFont -- Module for using bitmapped Fonts
PDF::Builder::Resource::Font::Postscript -- Support routines for using PostScript (Type 1) fonts
PDF::Builder::Resource::Font::SynFont -- Module for creating temporary synthetic Fonts

Down (Children)

PDF::Builder::Resource::Font::CoreFont::bankgothic -- Font-specific information for Bank Gothic font
PDF::Builder::Resource::Font::CoreFont::courier -- Font-specific information for regular Courier font
PDF::Builder::Resource::Font::CoreFont::courierbold -- Font-specific information for bold weight Courier font
PDF::Builder::Resource::Font::CoreFont::courierboldoblique -- Font-specific information for bold weight + slanted Courier font
PDF::Builder::Resource::Font::CoreFont::courieroblique -- Font-specific information for slanted Courier font
PDF::Builder::Resource::Font::CoreFont::georgia -- Font-specific information for regular Georgia font
PDF::Builder::Resource::Font::CoreFont::georgiabold -- Font-specific information for bold weight Georgia font
PDF::Builder::Resource::Font::CoreFont::georgiabolditalic -- Font-specific information for bold weight + italic Georgia font
PDF::Builder::Resource::Font::CoreFont::georgiaitalic -- Font-specific information for italic Georgia font
PDF::Builder::Resource::Font::CoreFont::helvetica -- Font-specific information for regular Helvetica font
PDF::Builder::Resource::Font::CoreFont::helveticabold -- Font-specific information for bold weight Helvetica font
PDF::Builder::Resource::Font::CoreFont::helveticaboldoblique -- Font-specific information for bold weight + slanted Helvetica font
PDF::Builder::Resource::Font::CoreFont::helveticaoblique -- Font-specific information for slanted Helvetica font
PDF::Builder::Resource::Font::CoreFont::symbol -- Font-specific information for the Symbol font
PDF::Builder::Resource::Font::CoreFont::timesbold -- Font-specific information for bold weight Times font
PDF::Builder::Resource::Font::CoreFont::timesbolditalic -- Font-specific information for bold weight + italic Times font
PDF::Builder::Resource::Font::CoreFont::timesitalic -- Font-specific information for italic Times font
PDF::Builder::Resource::Font::CoreFont::timesroman -- Font-specific information for regular (roman) Times font
PDF::Builder::Resource::Font::CoreFont::trebuchet -- Font-specific information for regular Trebuchet font
PDF::Builder::Resource::Font::CoreFont::trebuchetbold -- Font-specific information for bold-weight Trebuchet font
PDF::Builder::Resource::Font::CoreFont::trebuchetbolditalic -- Font-specific information for bold weight + italic Trebuchet font
PDF::Builder::Resource::Font::CoreFont::trebuchetitalic -- Font-specific information for italic Trebuchet font
PDF::Builder::Resource::Font::CoreFont::verdana -- Font-specific information for regular Verdana font
PDF::Builder::Resource::Font::CoreFont::verdanabold -- Font-specific information for bold weight Verdana font
PDF::Builder::Resource::Font::CoreFont::verdanabolditalic -- Font-specific information for bold weight + italic Verdana font
PDF::Builder::Resource::Font::CoreFont::verdanaitalic -- Font-specific information for italic Verdana font
PDF::Builder::Resource::Font::CoreFont::webdings -- Font-specific information for WebDings symbol font
PDF::Builder::Resource::Font::CoreFont::wingdings -- Font-specific information for WingDings symbol font
PDF::Builder::Resource::Font::CoreFont::zapfdingbats -- Font-specific information for Zapf Dingbats symbol font

 

All content © copyright 2005 – 2026 by Catskill Technology Services, LLC.
All rights reserved.
Note that Third Party software (whether Open Source or proprietary) on this site remains under the copyright and license of its owners. Catskill Technology Services, LLC does not claim copyright over such software.

 

This page is https://www.catskilltech.com/Documentation/PDF/Builder/Resource/Font/CoreFont.html

Search Quotations database.

Last updated Thu, 01 Jan 2026 at 7:54 PM

Valid HTML 5

Thu, 16 Apr 2026 at 7:05 AM EDT