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
| Name | Type | Access | Description |
|---|---|---|---|
font_type | FontType | Read | Gets the font type. |
font_name | str | Read | Gets the font name. |
font_family | str | Read | Gets the font family. |
font_style | str | Read | Gets the font style. |
num_glyphs | int | Read | Gets the num glyphs. |
metrics | FontMetrics | Read | Gets the metrics. |
encoding | CffEncoding | Read | Gets the encoding. |
glyph_accessor | GlyphAccessor | Read | Gets the glyph accessor. |
charstrings | CffIndex | Read | Gets the charstrings. |
global_subrs | CffIndex | Read | Gets the global subrs. |
local_subrs | CffIndex | Read | Gets the local subrs. |
charset | CffCharset | Read | Gets the charset. |
private_dict | PrivateDict | Read | Gets the private dict. |
variable_axes | list[VariableAxis] | Read | Gets the variable axes. |
Methods
| Signature | Description |
|---|---|
__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]) → float | Computes 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) → bytes | Calls 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) → Font | Calls convert(target) on this Cff2Font instance. |