TrueTypeOutlines

TrueTypeOutlines

Overview

TrueTypeOutlines is a class in Aspose.PDF FOSS for Python.

Decode glyph outlines from an embedded TrueType (glyf) program.

This class provides 3 methods for working with TrueTypeOutlines objects in Python programs. Available methods include: __init__, advance_width, outline. All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package. Properties: num_glyphs, ok, units_per_em.

Properties

NameTypeAccessDescription
okboolReadTrue when a TrueType glyf program was parsed successfully.
units_per_em``ReadGets the units per em.
num_glyphs``ReadGets the num glyphs.

Methods

SignatureDescription
__init__(font_bytes: bytes)Calls init(font_bytes) on this TrueTypeOutlines instance.
outline(gid: int)list[Contour]Return flattened, closed contours for gid in font units (y up).
advance_width(gid: int)int | NoneReturn gid’s advance width in font units from hmtx, or None.

See Also