Skip to content

Font object

FontObject

Provides information about a specific font.

The Font object provides information about a specific font, along with the font technology used, helping disambiguate when multiple fonts sharing the same PostScript name are installed on the system.

Example
from py_aep import parse

app = parse("project.aep")
comp = app.project.compositions[0]
font = comp.text_layers[0].text.source_text.value.font_object
print(font.post_script_name)
Note

This functionality was added in After Effects 24.0.

See: https://ae-scripting.docsforadobe.dev/text/fontobject/

Attributes

design_vector

design_vector = CosField["list[float] | None"](
    "_font_data",
    "4",
    transform=_design_vector_from_cos,
    read_only=True,
)

For variable fonts, an ordered array with a length matching the number of design axes defined by the font. None for non-variable fonts. Read-only.

Stored in the file as 16.16 fixed-point integers; exposed as floats (e.g. [700.0, 87.5]).

family_prefix

family_prefix: str | None

The family prefix of the variable font. For example, the family of the PostScript name SFPro-Bold is SFPro. None for non-variable fonts. Read-only.

has_design_axes

has_design_axes: bool

Returns True if the font is a variable font. Read-only.

post_script_name

post_script_name = CosField[str](
    "_font_data", "0", transform=str, default=""
)

The PostScript name of the font. Read-only.

version

version = CosField[str](
    "_font_data", "5", transform=str, default=None
)

The version number of the font. Read-only.