Type1Outlines

Overview

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

Decode glyph outlines from a Type 1 (/FontFile) font program.

This class provides 3 methods for working with Type1Outlines 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: builtin_encoding, glyph_names, name_to_gid, num_glyphs, ok, units_per_em.

Properties

NameTypeAccessDescription
okboolReadTrue when a Type 1 program with charstrings was parsed.
units_per_em``ReadGets the units per em.
num_glyphs``ReadGets the num glyphs.
glyph_nameslist[str]ReadGets the glyph names.
name_to_giddict[str, int]ReadGets the name to gid.
builtin_encodingdict[int, str]ReadGets the builtin encoding.

Methods

SignatureDescription
__init__(font_bytes: bytes, length1: int | None, length2: int | None)Calls init(font_bytes, length1, length2) on this Type1Outlines instance.
outline(gid: int)list[Contour]Return flattened, closed contours for gid in font units (y up).
advance_width(gid: int)int | NoneType 1 advance widths are not surfaced (PDF /Widths is used).

See Also