Outline

class freetype.Outline(outline)

FT_Outline wrapper.

This structure is used to describe an outline to the scan-line converter.

contours

The number of contours in the outline.

flags

A set of bit flags used to characterize the outline and give hints to the scan-converter and hinter on how to convert/grid-fit it. See FT_OUTLINE_FLAGS.

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 when the two boxes coincide. Otherwise, the outline Bezier arcs are traversed to extract their extrema.

get_cbox()

Return an outline’s ‘control box’. The control box encloses all the outline’s points, including Bezier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline which contains Bezier outside arcs).

Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the ‘ftbbox’ component which is dedicated to this single task.

get_inside_border()

Retrieve the FT_StrokerBorder value corresponding to the ‘inside’ borders of a given outline.

Returns:The border index. FT_STROKER_BORDER_RIGHT for empty or invalid outlines.
get_outside_border()

Retrieve the FT_StrokerBorder value corresponding to the ‘outside’ borders of a given outline.

Returns:The border index. FT_STROKER_BORDER_RIGHT for empty or invalid outlines.
points

The number of points in the outline.

tags

A list of ‘n_points’ chars, giving each outline point’s type.

If bit 0 is unset, the point is ‘off’ the curve, i.e., a Bezier control point, while it is ‘on’ if set.

Bit 1 is meaningful for ‘off’ points only. If set, it indicates a third-order Bezier arc control point; and a second-order control point if unset.

If bit 2 is set, bits 5-7 contain the drop-out mode (as defined in the OpenType specification; the value is the same as the argument to the SCANMODE instruction).

Bits 3 and 4 are reserved for internal purposes.