freetypy.Outline.get_bbox¶
-
Outline.get_bbox()¶ Compute the exact bounding box of an outline. This is slower than computing the control box. However, it uses an advanced algorithm which returns very quickly with the two boxes coincide. Otherwise, the outline Bézier arcs are traversed to extract their extrema.
Returns: bbox : BBox
The outline’s exact bounding box.
Notes
If the font is tricky and the glyph has been loaded with
LOAD.NO_SCALE, the resultingBBoxis meaningless. To get reasonable values for theBBoxit is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting theBBoxwhich can be eventually converted back to font units.