PDF::AP...SynFont(3)

πŸ’– PDF::AP...SynFont(3) β€” the bestie manual πŸ’–

okay so you found the page for PDF::API2::Resource::Font::SynFont, bestie. it lives in the User Contributed Perl Documentation section, and it's giving font glow-up factory. let's get into it πŸŽ€


✨ NAME ✨

PDF::API2::Resource::Font::SynFont β€” the module for creating synthetic Fonts. that's it, that's the whole vibe. synthetic fonts, no cap. πŸ’…


🌸 SYNOPSIS 🌸

here's the whole little story, copy it exactly or the PDF gods will be mad at you:

my $pdf = PDF::API2->new();
my $base_font = $pdf->font('Helvetica');

# Create a condensed synthetic font
my $condensed = $pdf->synthetic_font($base_font, hscale => 80);

# Compare the two fonts
my $text = $pdf->page->text();

$text->font($base_font, 18);
$text->distance(72, 720);
$text->text('Hello World!');

$text->font($condensed, 18);
$text->distance(0, -36);
$text->text('Hello World!');

$pdf->save('sample.pdf');

so you make a $pdf, you grab a $base_font with $pdf->font('Helvetica'), then β€” the main character moment β€” you build a condensed synthetic font with hscale => 80. then you compare them side by side, same 'Hello World!' text, and $pdf->save('sample.pdf'). iconic behavior, honestly. πŸ¦‹


🌈 DESCRIPTION 🌈

this module lets you create a custom font based on an existing font. you're adjusting the scale, the stroke thickness, the angle, and other properties of each glyph. it's like a makeover montage but for letters. ✨


πŸ‘‘ FONT OPTIONS πŸ‘‘

these are the levers you can pull, bestie. each one changes your glyphs in its own special way.

πŸ“ hscale

a percentage to condense (less than 100) or expand (greater than 100) the glyphs horizontally. so < 100 = squish, > 100 = stretch. horizontal only, periodt.

🧚 angle

a number of degrees to lean the glyphs to the left (negative angle) or to the right (positive angle). negative goes left, positive goes right. it's giving italics but make it custom.

πŸ”₯ bold

a stroke width, in thousandths of a text unit, to add to the glyph's outline, creating a bold effect. thickness = boldness. simple math, gorgeous result.

⭐ smallcaps

set to true to replace lower-case characters with small versions of their upper-case glyphs. lowercase who? never heard of her. πŸ’€

🌸 space

additional space, in thousandths of a text unit, to add between glyphs. personal space for your letters, as a treat.


lowkey reminder: all those "thousandths of a text unit" numbers are exact units from the original page, so don't round them in your head and then act surprised when your font looks different. fr fr. 🫢

and that's the whole page, bestie!! this manual came from perl v5.42.0, dated 2025-09-01, and the page header/footer both said PDF::AP...SynFont(3) β€” mwah, iconic, no notes. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • fedora 43: perl-PDF-API2 2.048-1.fc43 Β· LGPL-2.1-or-later AND (GPL-1.0-or-later OR Artistic-1.0-Perl) AND (MIT OR Artistic-1.0-Perl)
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms