TrueTypeFont
Overview
TrueTypeFont is a class in Aspose.Page FOSS for Python.
TrueTypeFont offers low‑level glyph metrics such as advance width, vertical advance, and outline points for precise text layout.
This class provides 12 methods for working with TrueTypeFont objects in Python programs.
Available methods include: __init__, glyph_advance, glyph_id_for_code, glyph_outline, glyph_sideways_advance, glyph_top_origin_x, glyph_top_origin_y_and_descender, glyph_vertical_advance, glyph_vertical_metrics, glyph_y_max, line_spacing_units, typo_ascender_units.
All public members are accessible to any Python application after installing the Aspose.Page FOSS for Python package.
Properties: units_per_em.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
units_per_em | `` | Read | Gets the units per em. |
Methods
| Signature | Description |
|---|---|
__init__(data: bytes) | |
glyph_id_for_code(code: int) → int | |
glyph_advance(glyph_id: int) → float | |
glyph_vertical_advance(glyph_id: int) → float | None | |
line_spacing_units() → float | |
typo_ascender_units() → float | |
glyph_top_origin_x(glyph_id: int) → float | |
glyph_top_origin_y_and_descender(glyph_id: int) → tuple[float, float] | |
glyph_sideways_advance(glyph_id: int) → float | |
glyph_vertical_metrics(glyph_id: int) → tuple[float, float] | None | |
glyph_y_max(glyph_id: int) → int | None | |
glyph_outline(glyph_id: int) → list[list[GlyphPoint]] |