Cff2Font

Overview

Cff2Font is a class in Aspose.Font FOSS for Python. Inherits from: Font.

High-level CFF2 variable font API.

This class declares 12 methods for Cff2Font objects in Python programs. Available methods include: __init__, blend, convert, export, get_axes, get_kern_pairs, instantiate, list_axes, load, save, save_to_format, to_bytes. Public members are accessible to any Python application after installing the Aspose.Font FOSS for Python package. Properties: charset, charstrings, encoding, font_family, font_name, font_style, and 8 more.

Properties

NameTypeAccessDescription
font_typeFontTypeReadGets the font type.
font_namestrReadGets the font name.
font_familystrReadGets the font family.
font_stylestrReadGets the font style.
num_glyphsintReadGets the num glyphs.
metricsFontMetricsReadGets the metrics.
encodingCffEncodingReadGets the encoding.
glyph_accessorGlyphAccessorReadGets the glyph accessor.
charstringsCffIndexReadGets the charstrings.
global_subrsCffIndexReadGets the global subrs.
local_subrsCffIndexReadGets the local subrs.
charsetCffCharsetReadGets the charset.
private_dictPrivateDictReadGets the private dict.
variable_axeslist[VariableAxis]ReadGets the variable axes.

Methods

SignatureDescription
__init__(data: bytes)Initialize CFF2 font from raw font data.
get_axes() → list[VariableAxis]Returns the axes.
list_axes() → list[VariableAxis]Calls list_axes on this Cff2Font instance.
blend(value_dict: dict[str, float]) → floatComputes the blended coordinate value for a given axis dictionary and returns the resulting float
load(path: str | Path) → "Cff2Font"Load CFF2 font from file path.
instantiate(instance_coords: dict[str, float]) → "CffFont"Instantiate CFF2 font at specified coordinates.
export(output_path: str)Writes the current font data to the specified file in its native CFF2 format
save(path: str)Calls save(path) on this Cff2Font instance.
to_bytes(font_type: FontType | None) → bytesCalls to_bytes(font_type) on this Cff2Font instance.
save_to_format(font_type: FontType, path: str)Calls save_to_format(font_type, path) on this Cff2Font instance.
get_kern_pairs() → list[KernPair]Return all kern pairs for this font.
convert(target: FontType) → FontCalls convert(target) on this Cff2Font instance.

See Also