.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "PDF::Builder::Resource::BaseFont 3" .TH PDF::Builder::Resource::BaseFont 3 2026-02-08 "perl v5.42.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME PDF::Builder::Resource::BaseFont \- Base class for font resources .PP Inherits from PDF::Builder::Resource .SH METHODS .IX Header "METHODS" .SS new .IX Subsection "new" .Vb 1 \& $font = PDF::Builder::Resource::BaseFont\->new($pdf, $name) .Ve .Sp .RS 4 Return a font resource object. .RE .SS descrByData .IX Subsection "descrByData" .Vb 1 \& $descriptor = $font\->descrByData() .Ve .Sp .RS 4 Return the font\*(Aqs FontDescriptor key structure based on the font\*(Aqs data. .RE .SH "FONT\-MANAGEMENT RELATED METHODS" .IX Header "FONT-MANAGEMENT RELATED METHODS" .SS fontname .IX Subsection "fontname" .Vb 1 \& $name = $font\->fontname() .Ve .Sp .RS 4 Return the font\*(Aqs name (a.k.a. display name). .RE .SS altname .IX Subsection "altname" .Vb 1 \& $name = $font\->altname() .Ve .Sp .RS 4 Return the font\*(Aqs alternative name (a.k.a. Windows name for a PostScript font). .RE .SS subname .IX Subsection "subname" .Vb 1 \& $name = $font\->subname() .Ve .Sp .RS 4 Return the font\*(Aqs subname (a.k.a. font variant). .RE .SS apiname .IX Subsection "apiname" .Vb 1 \& $name = $font\->apiname() .Ve .Sp .RS 4 Return the font\*(Aqs name to be used internally (should be equal to \f(CW$font\fR\->\fBname()\fR). .RE .SS issymbol .IX Subsection "issymbol" .Vb 1 \& $issymbol = $font\->issymbol() .Ve .Sp .RS 4 Return the font\*(Aqs symbol flag (i.e., is this a symbol font). .RE .SS iscff .IX Subsection "iscff" .Vb 1 \& $iscff = $font\->iscff() .Ve .Sp .RS 4 Return the font\*(Aqs Compact Font Format flag. .RE .SH "TYPOGRAPHY\-RELATED METHODS" .IX Header "TYPOGRAPHY-RELATED METHODS" .SS upem .IX Subsection "upem" .Vb 1 \& $upem = $font\->upem() .Ve .Sp .RS 4 Return the font\*(Aqs scaling factor (Units Per em). It is typically 1000 in most fonts, but more recent TTF and OTF fonts often use 2048 units. .RE .SS fontbbox .IX Subsection "fontbbox" .Vb 1 \& ($llx,$lly, $urx,$ury) = $font\->fontbbox() .Ve .Sp .RS 4 Return the font\*(Aqs bounding box. .RE .SS capheight .IX Subsection "capheight" .Vb 1 \& $capheight = $font\->capheight() .Ve .Sp .RS 4 Return the font\*(Aqs capheight value. .RE .SS xheight .IX Subsection "xheight" .Vb 1 \& $xheight = $font\->xheight() .Ve .Sp .RS 4 Return the font\*(Aqs xheight value. .RE .SS missingwidth .IX Subsection "missingwidth" .Vb 1 \& $missingwidth = $font\->missingwidth() .Ve .Sp .RS 4 Return the font\*(Aqs missingwidth value. .RE .SS maxwidth .IX Subsection "maxwidth" .Vb 1 \& $maxwidth = $font\->maxwidth() .Ve .Sp .RS 4 Return the font\*(Aqs maxwidth value. .RE .SS avgwidth .IX Subsection "avgwidth" .Vb 1 \& $avgwidth = $font\->avgwidth() .Ve .Sp .RS 4 Return the font\*(Aqs avgwidth (average width) value. .RE .SS flags .IX Subsection "flags" .Vb 1 \& $flags = $font\->flags() .Ve .Sp .RS 4 Return the font\*(Aqs flags value. .RE .SS stemv .IX Subsection "stemv" .Vb 1 \& $stemv = $font\->stemv() .Ve .Sp .RS 4 Return the font\*(Aqs stemv value. .RE .SS stemh .IX Subsection "stemh" .Vb 1 \& $stemh = $font\->stemh() .Ve .Sp .RS 4 Return the font\*(Aqs stemh value. .RE .SS italicangle .IX Subsection "italicangle" .Vb 1 \& $italicangle = $font\->italicangle() .Ve .Sp .RS 4 Return the font\*(Aqs italicangle (slant, obliqueness) value. .RE .SS isfixedpitch .IX Subsection "isfixedpitch" .Vb 1 \& $isfixedpitch = $font\->isfixedpitch() .Ve .Sp .RS 4 Return the font\*(Aqs isfixedpitch flag. .RE .SS underlineposition .IX Subsection "underlineposition" .Vb 1 \& $underlineposition = $font\->underlineposition() .Ve .Sp .RS 4 Return the font\*(Aqs underlineposition value. .RE .SS underlinethickness .IX Subsection "underlinethickness" .Vb 1 \& $underlinethickness = $font\->underlinethickness() .Ve .Sp .RS 4 Return the font\*(Aqs underlinethickness value. .RE .SS ascender .IX Subsection "ascender" .Vb 1 \& $ascender = $font\->ascender() .Ve .Sp .RS 4 Return the font\*(Aqs ascender value. .RE .SS descender .IX Subsection "descender" .Vb 1 \& $descender = $font\->descender() .Ve .Sp .RS 4 Return the font\*(Aqs descender value. .RE .SH "GLYPH\-RELATED METHODS" .IX Header "GLYPH-RELATED METHODS" .SS glyphNames .IX Subsection "glyphNames" .Vb 1 \& @names = $font\->glyphNames() .Ve .Sp .RS 4 Return the defined glyph names of the font. .RE .SS glyphNum .IX Subsection "glyphNum" .Vb 1 \& $glNum = $font\->glyphNum() .Ve .Sp .RS 4 Return the number of defined glyph names of the font. .RE .SS uniByGlyph .IX Subsection "uniByGlyph" .Vb 1 \& $uni = $font\->uniByGlyph($char) .Ve .Sp .RS 4 Return the unicode by glyph name. .RE .SS uniByEnc .IX Subsection "uniByEnc" .Vb 1 \& $uni = $font\->uniByEnc($char) .Ve .Sp .RS 4 Return the Unicode by the font\*(Aqs encoding map. .RE .SS uniByMap .IX Subsection "uniByMap" .Vb 1 \& $uni = $font\->uniByMap($char) .Ve .Sp .RS 4 Return the Unicode by the font\*(Aqs default map. .RE .SS encByGlyph .IX Subsection "encByGlyph" .Vb 1 \& $char = $font\->encByGlyph($glyph) .Ve .Sp .RS 4 Return the character by the given glyph name of the font\*(Aqs encoding map. .RE .SS encByUni .IX Subsection "encByUni" .Vb 1 \& $char = $font\->encByUni($uni) .Ve .Sp .RS 4 Return the character by the given Unicode of the font\*(Aqs encoding map. .RE .SS mapByGlyph .IX Subsection "mapByGlyph" .Vb 1 \& $char = $font\->mapByGlyph($glyph) .Ve .Sp .RS 4 Return the character by the given glyph name of the font\*(Aqs default map. .RE .SS mapByUni .IX Subsection "mapByUni" .Vb 1 \& $char = $font\->mapByUni($uni) .Ve .Sp .RS 4 Return the character by the given Unicode of the font\*(Aqs default map. .RE .SS glyphByUni .IX Subsection "glyphByUni" .Vb 1 \& $name = $font\->glyphByUni($unicode) .Ve .Sp .RS 4 Return the glyph\*(Aqs name by the font\*(Aqs Unicode map. \&\fBCAUTION:\fR non\-standard glyph\-names are mapped onto the ms\-symbol area (0xF000). .RE .SS glyphByEnc .IX Subsection "glyphByEnc" .Vb 1 \& $name = $font\->glyphByEnc($char) .Ve .Sp .RS 4 Return the glyph\*(Aqs name by the font\*(Aqs encoding map. .RE .SS glyphByMap .IX Subsection "glyphByMap" .Vb 1 \& $name = $font\->glyphByMap($char) .Ve .Sp .RS 4 Return the glyph\*(Aqs name by the font\*(Aqs default map. .RE .SS wxByGlyph .IX Subsection "wxByGlyph" .Vb 1 \& $width = $font\->wxByGlyph($glyph) .Ve .Sp .RS 4 Return the glyph\*(Aqs width. This is a value, that when divided by 1000 and multiplied by the font size (height in points), gives the advance width to the next character\*(Aqs start. Typically, the width will be under 1000. .RE .SS wxByUni .IX Subsection "wxByUni" .Vb 1 \& $width = $font\->wxByUni($uni) .Ve .Sp .RS 4 Return the Unicode character\*(Aqs width. This is a value, that when divided by 1000 and multiplied by the font size (height in points), gives the advance width to the next character\*(Aqs start. Typically, the width will be under 1000. .RE .SS wxByEnc .IX Subsection "wxByEnc" .Vb 1 \& $width = $font\->wxByEnc($char) .Ve .Sp .RS 4 Return the character\*(Aqs width based on the current encoding. This is a value, that when divided by 1000 and multiplied by the font size (height in points), gives the advance width to the next character\*(Aqs start. Typically, the width will be under 1000. .RE .SS wxMissingByEnc .IX Subsection "wxMissingByEnc" .Vb 1 \& $flag = $font\->wxMissingByEnc($char) .Ve .Sp .RS 4 Return true if the character\*(Aqs width (based on the current encoding) is supplied by "missing width" of font. .RE .SS wxByMap .IX Subsection "wxByMap" .Vb 1 \& $width = $font\->wxByMap($char) .Ve .Sp .RS 4 Return the character\*(Aqs width based on the font\*(Aqs default encoding. This is a value, that when divided by 1000 and multiplied by the font size (height in points), gives the advance width to the next character\*(Aqs start. Typically, the width will be under 1000. .RE .SS width .IX Subsection "width" .Vb 1 \& $wd = $font\->width($text) .Ve .Sp .RS 4 Return the width of \f(CW$text\fR as if it were at font size 1 (unscaled). \&\fBCAUTION:\fR works correctly only if a proper Perl string is used, either in native or UTF\-8 format (check utf8\-flag). .RE .SS width_array .IX Subsection "width_array" .Vb 1 \& @widths = $font\->width_array($text) .Ve .Sp .RS 4 Return (as an array) the widths of the words in \f(CW$text\fR as if they were at size 1. .RE .SS utfByStr .IX Subsection "utfByStr" .Vb 1 \& $utf8string = $font\->utfByStr($string) .Ve .Sp .RS 4 Return the utf8\-string from string based on the font\*(Aqs encoding map. .RE .SS strByUtf .IX Subsection "strByUtf" .Vb 1 \& $string = $font\->strByUtf($utf8_string) .Ve .Sp .RS 4 Return the encoded string from utf8\-string based on the font\*(Aqs encoding map. .RE .SS textByStr .IX Subsection "textByStr" .Vb 1 \& $pdf_string = $font\->textByStr($string) .Ve .Sp .RS 4 Return a properly formatted representation of \f(CW$string\fR for use in the PDF. .RE .SS textByStrKern .IX Subsection "textByStrKern" .Vb 1 \& $pdf_string = $font\->textByStrKern($string) .Ve .Sp .RS 4 Return a properly formatted representation of \f(CW$string\fR, with kerning, for use in the PDF. .RE