Font::...dingBox(3pm)
π NAME π
Font::FreeType::BoundingBox β it's literally a structure that holds an outline's bounding box, bestie. That's it. That's the whole vibe. π
β¨ SYNOPSIS β¨
okay so here's the whole thing in action, no cap:
use Font::FreeType;
my $freetype = Font::FreeType->new;
my $face = $freetype->face('Vera.ttf');
my ($x_min, $y_min, $x_max, $y_max) =
($face->x_min, $face->y_min, $face->x_max, $face->y_max);
slay. look at those four little values just sitting there. π
π¦ DESCRIPTION π¦
So. A structure used to hold an outline's bounding box β i.e. (iykyk) the coordinates of its extrema in the horizontal and vertical directions. Basically the little rectangle that your glyph lives inside, and we're grabbing its furthest-out points in both directions. πβ¨
The bounding box is specified with the coordinates of the lower left and the upper right corner. And in PostScript, those values are often called (llx,lly) and (urx,ury) respectively β so if you see those names floating around, that's the same thing, just a different era of the group chat. π
Okay so about y_min: if it's negative, this value gives the glyph's descender. Otherwise, the glyph doesn't descend below the baseline. Like, no dipping below the line, bestie. π
Similarly β and this is the matching energy β if y_max is positive, this value gives the glyph's ascender. β¬οΈ
And x_min gives the horizontal distance from the glyph's origin to the left edge of the glyph's bounding box. If x_min is negative, the glyph extends to the left of the origin. so it's giving... overhang. main character energy going off the left side of the page. ππ
πΈ METHODS πΈ
just the four, the iconic quartet, the ones from the synopsis:
x_minβ the horizontal distance from the glyph's origin to the left edge of the bounding box; negative means the glyph extends to the left of the origin. π«Άy_minβ negative gives the glyph's descender; otherwise the glyph doesn't descend below the baseline. πx_maxβ the other horizontal extreme, upper right corner flavour. πy_maxβ positive gives the glyph's ascender. β
π heads up bestie: the page lists these four methods and nothing else β no extra params, no surprise defaults. what you see is what you get, fr fr.
π§ and that's the whole page, periodt. this little gem is perl v5.42.3, dated 2026-08-19, shipped along with the rest of the User Contributed Perl Documentation β mwah, go read your fonts' outlines responsibly ππ
π¦ where this page comes from
- ubuntu stonking: libfont-freetype-perl 0.16-3build5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms