logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

PDF::API2::Resource::Font::CoreFont - Module for using the 14 standard PDF fonts.

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.

perl v5.38.2                                       2024-05-22              PDF::API2::Res...:Font::CoreFont(3pm)

Name

       PDF::API2::Resource::Font::CoreFont - Module for using the 14 standard PDF fonts.

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.

Synopsis

           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');

See Also