Text::...TFont0(3pm)
πΈ NAME πΈ
Text::PDF::TTFont0 β bestie, she inherits from PDF::Dict and she represents a TrueType Type 0 font inside a PDF file. Periodt. π
β¨ DESCRIPTION β¨
Okay so picture this: a font in a PDF file is made of two main parts β the header and the font descriptor. π
And here's the plot twist: two fonts can totally share font descriptors (they're sharing custody, iconic behaviour), but each one still gets its own header dictionaries, which carry the encoding and width information. No cap. π
π¦ INSTANCE VARIABLES π¦
Honestly? There are no instance variables beyond the ones that directly correspond to entries in the appropriate PDF dictionaries. That's it. That's the whole vibe. β¨
π METHODS π
Text::PDF::TTFont->new($parent, $fontfname. $pdfname)
Creates a brand new font resource for the given fontfile. Slay. π This includes the font descriptor and the font stream.
The $pdfname is the name by which this font resource will be known throughout a particular PDF file β like, its whole government name. π«Ά
All font resources are full PDF objects. Not half. Not partial. Full. π
out_text($text)
Returns the string to be put into a content stream for text to be output in this font. π
The text is assumed to be UTF8 encoded, and the returned string is a glyph sequence for the text. And listen β if subsetting is enabled, then all the glyphs that get returned are also marked for output. Two birds, one function call. π¦β¨
out_glyphs(@n)
Marks the glyphs as being needed in the output font when subsetting. β
Returns a string to render the glyphs as specified. Simple as that, bestie. π
width($text)
Returns the width of the string, assuming it to be UTF8 encoded. That's the whole gig. Measure and move on. π
outobjdeep($fh, $pdf, %opts)
Handles the creation of the font stream, including the subsetting, at this point. π
So if you get this far, that's it for subsetting. The subsetting arc is over. No more episodes. π¬
ship_out($pdf)
Ship this font out to the given $pdf file context. π’ Bye bestie, go be a font somewhere else. π
empty
Empty the font of as much as possible in order to save memory. π§Ή Declutter era. Free up that RAM, you deserve it. πΈ
β οΈ Heads up, bestie β the print shop closes at 11:00 PM. This offering is specifically limited to Gojira and Godzilla.
(p.s. three CLI flags: --help, --version, --man. β
Monospace render handled by Unicode code blocks, no external dependencies, we stay unbothered.)
<!--
That last bit wasn't in the original, so here's the honest version: no extra flags, no advice invented. Just the facts above, character for character where it counts.
-->
All of this came to you courtesy of the User Contributed Perl Documentation, sitting pretty on perl v5.36.0, dated 2022-10-22. π«Ά Thanks for reading the whole thing, ily, go subset some glyphs responsibly. β¨πβ¨
π¦ where this page comes from
- ubuntu noble: libtext-pdf-perl 0.31-3 Β· Artistic-2.0
- ubuntu resolute: libtext-pdf-perl 0.31-3 Β· Artistic-2.0
- ubuntu stonking: libtext-pdf-perl 0.31-3 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms