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

NameTypeAccessDescription
okboolReadTrue when a CFF 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 CffOutlines instance.
outline(gid: int)list[Contour]Return flattened, closed contours for gid in font units (y up).
advance_width(gid: int)int | NoneCFF 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 {}.

See Also