boundsPen
- class fontTools.pens.boundsPen.BoundsPen(glyphSet, ignoreSinglePoints=False)[source]
Bases:
ControlBoundsPenPen to calculate the bounds of a shape. It calculates the correct bounds even when the shape contains curves that don’t have points on their extremes. This is somewhat slower to compute than the “control bounds”.
When the shape has been drawn, the bounds are available as the
boundsattribute of the pen object. It’s a 4-tuple:(xMin, yMin, xMax, yMax)
- class fontTools.pens.boundsPen.ControlBoundsPen(glyphSet, ignoreSinglePoints=False)[source]
Bases:
BasePenPen to calculate the “control bounds” of a shape. This is the bounding box of all control points, so may be larger than the actual bounding box if there are curves that don’t have points on their extremes.
When the shape has been drawn, the bounds are available as the
boundsattribute of the pen object. It’s a 4-tuple:(xMin, yMin, xMax, yMax).
If
ignoreSinglePointsis True, single points are ignored.