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::Font - Base font class for PDF::Create.

Authors

       Mohammad S Anwar (MANWAR) "<mohammad.anwar at yahoo.com>"

Constructor

       Expects "font_name" as the only parameter. It can be one of the following names:

       •   Courier

       •   Courier-Bold

       •   Courier-BoldOblique

       •   Courier-Oblique

       •   Helvetica

       •   Helvetica-Bold

       •   Helvetica-BoldOblique

       •   Helvetica-Oblique

       •   Times-Bold

       •   Times-BoldItalic

       •   Times-Italic

       •   Times-Roman

       •   Symbol

Description

       Base font class to support font families approved by PDF::Create. This is used in the method
       init_widths() inside the package PDF::Create::Page.

License

       This is free software; you can redistribute it and / or modify it under the same terms as Perl 5.6.0.

perl v5.38.2                                       2024-03-07                                     PDF::Font(3pm)

Methods

char_width()
       Returns arrayref of all characters width (0..255).

   get_char_width($codepoint)
       Returns the character width for the given $codepoint.

   get_char_name($codepoint)
       Returns the character name for the given $codepoint.

Name

       PDF::Font - Base font class for PDF::Create.

Repository

       <https://github.com/manwar/pdf-create>

Synopsis

           use strict; use warnings;
           use PDF::Font;

           my $font = PDF::Font->new('Helvetica');
           my $char_widths = $font->char_width;
           print "Character width: ", $font->get_char_width(ord('A')), "\n";
           print "Character  name: ", $font->get_char_name(ord('A')) , "\n";

Version

       Version 1.46

See Also