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 resulting BBox is meaningless. To get reasonable values for the BBox 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 the BBox which can be eventually converted back to font units.