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 – The outline’s exact bounding box. Return type: BBox Notes
If the font is tricky and the glyph has been loaded with
LOAD.NO_SCALE
, the resultingBBox
is meaningless. To get reasonable values for theBBox
it 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 theBBox
which can be eventually converted back to font units.