perldoc > PDF::API2::Resource::BaseFont

📛 NAME

PDF::API2::Resource::BaseFont – Base class for font resources

🚀 Quick Reference

Use CaseCommandDescription
Create a font resource$font = PDF::API2::Resource::BaseFont->new($pdf, $name)Returns a font resource object
Get the font’s display name$font->fontname()Returns the font name
Get the font’s bounding box($llx, $lly, $urx, $ury) = $font->fontbbox()Returns the four coordinates of the font bounding box
Get a glyph name from a Unicode$name = $font->glyphByUni($uni)Returns the glyph’s name for the given Unicode
Measure the width of a string$wd = $font->width($text)Returns the width of $text at size 1
Decode a string to UTF‑8$utf8_string = $font->utfByStr($string)Decodes using the font’s encoding map
Encode a UTF‑8 string$string = $font->strByUtf($utf8_string)Encodes to the font’s encoding
Get the PDF‑ready representation$pdf_string = $font->textByStr($text)Returns a properly formatted content string for the PDF

🛠️ METHODS

🔤 FONT‑MANAGEMENT RELATED METHODS

📐 TYPOGRAPHY RELATED METHODS

🔣 GLYPH RELATED METHODS

📝 STRING METHODS

PDF::API2::Resource::BaseFont
📛 NAME 🚀 Quick Reference 🛠️ METHODS 🔤 FONT‑MANAGEMENT RELATED METHODS 📐 TYPOGRAPHY RELATED METHODS 🔣 GLYPH RELATED METHODS 📝 STRING METHODS

Generated by phpman v4.9.29 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-22 00:26 @2600:1f28:365:80b0:d8a5:c3c6:bf94:28c0
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^