CffOutlines
Overview
CffOutlines is a class in Aspose.PDF FOSS for Python.
Decode glyph outlines from a CFF (Type 2 charstring) font program.
This class provides 4 methods for working with CffOutlines objects in Python programs.
Available methods include: __init__, advance_width, encoding_code_to_gid, 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 CFF 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 CffOutlines instance. |
outline(gid: int) → list[Contour] | Return flattened, closed contours for gid in font units (y up). |
advance_width(gid: int) → int | None | CFF advance widths are not surfaced (PDF /Widths is authoritative). |
encoding_code_to_gid() → dict[int, int] | Return the CFF’s built-in custom Encoding as code -> gid, or {}. |