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