freetypy.BBox

class freetypy.BBox

An outline’s bounding box.

The bounding box is specified with the coordinates of the lower left and the upper right corner. In PostScript, those values are often called (llx, lly) and (urx, ury), respectively.

If y_min is negative, this value gives the glyph’s descender. Otherwise, the glyph doesn’t descend below the baseline. Similarly, if y_max is positive, this value gives the glyph’s ascender.

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.

BBox also works as a Python sequence, so it is easy to do:

x_min, y_min, x_max, y_max = bbox
__init__()

x.__init__(...) initializes x; see help(type(x)) for signature

Attributes

ascent The height of the bounding box above the baseline.
depth The depth of the bounding box below the baseline.
height The height of the bounding box (y_max - y_min).
width The width of the bounding box (x_max - x_min).
x_max The horizontal maximum (right-most).
x_min The horizontal minimum (left-most).
y_max The vertical maximum (top-most).
y_min The vertical minimum (bottom-most).