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
| Name | Type | Access | Description |
|---|---|---|---|
ok | bool | Read | True when a TrueType glyf program was parsed successfully. |
units_per_em | `` | Read | Gets the units per em. |
num_glyphs | `` | Read | Gets the num glyphs. |
Methods
| Signature | Description |
|---|---|
__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 | None | Return gid’s advance width in font units from hmtx, or None. |