PDF::API2::Resource::Font::CoreFont(3pm)

PDF::API2::Resource::Font::CoreFont3pm

Module for using the 14 standard pdf fonts.

Usage

    my $pdf = PDF::API2->new();
    my $font = $pdf->font('Times-Roman');
    my $page = $pdf->page();
    my $text = $page->text();
    $text->font($font, 20);
    $text->translate(200, 700);
    $text->text('Hello world!');
    $pdf->save('/path/to/new.pdf');

Standard fonts

The following fourteen fonts are available in all PDF readers that conform to the PDF specification:

•

Courier

•

Courier-Bold

•

Courier-BoldOblique

•

Courier-Oblique

•

Helvetica

•

Helvetica-Bold

•

Helvetica-BoldOblique

•

Helvetica-Oblique

•

Symbol

•

Times-Bold

•

Times-BoldItalic

•

Times-Italic

•

Times-Roman

•

ZapfDingbats

These fonts (except Symbol and ZapfDingbats) include glyphs for ASCII and certain Latin characters only. If other characters are needed, you will need to embed a font file.

Methods

is_standard

    my $boolean = PDF::API2::Resource::Font::CoreFont->is_standard($name);

Returns true if $name is an exact, case-sensitive match for one of the standard font names shown above.

names

    my @font_names = PDF::API2::Resource::Font::CoreFont->list();
    my $array_ref  = PDF::API2::Resource::Font::CoreFont->list();

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

Releases

11 releases since Debian 3.1 (Sarge); the text changed 10 times.

  1. 3.1
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12
  10. 13
  11. Arch

From perl-pdf-api2 2.048-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.