Features Overview
Features Overview
Aspose.Font FOSS for Python is a pure-Python toolkit for programmatic font processing. It covers the full lifecycle from loading a font file to exporting a modified or subsetted version, with no OS-level font library dependencies.
Font Loading
FontLoader accepts file paths and raw bytes. It auto-detects TTF, OTF, CFF, WOFF,
WOFF2, EOT, and Type 1 formats. Use FontLoader.open() for paths and FontLoader.load()
for byte arrays.
from aspose_font.loader import FontLoader
font = FontLoader.open("Roboto-Regular.ttf")Font Metadata Access
Font base class exposes font_name, font_family, font_style, num_glyphs,
encoding, glyph_accessor, and metrics.
Glyph Access and Outline Paths
GlyphAccessor provides get_glyph_by_id(), get_glyph_by_unicode(), and
get_glyphs_for_text(). Each Glyph object has a path of typed commands:
MoveTo, LineTo, QuadraticTo, CurveTo, ClosePath.
Font Conversion
FontConverter.convert() converts between all supported formats.
CurveAdapter adapts Bézier path types between quadratic and cubic.
Font Subsetting
FontSubsetter supports subset_by_text(), subset_by_gids(), subset_for_web(),
subset_by_presets(), and coverage analysis via analyze_coverage() and analyze_web_coverage().
Web Font Optimization
FontCleaner.clean_for_web() strips DSIG, FFTM, and meta tables and removes Mac
platform name records.
Variable Font Previews
AnimationPreviewBuilder generates animated APNG files for axis sweeps (build_axis_sweep())
and multi-step animation paths (build_path()). Results are AnimationAsset objects
that write to disk via write_to().
Compatibility Checking
CompatibilityChecker.compare_fonts() and compare_variable_instances() check glyph
outline compatibility between two font versions.
Format Support
| Format | Extension | Read | Write |
|---|---|---|---|
| TTF | .ttf | Yes | Yes |
| OTF | .otf | Yes | Yes |
| CFF | .cff | Yes | Yes |
| TYPE1 | .pfb / .pfa | Yes | Yes |
| WOFF | .woff | Yes | Yes |
| WOFF2 | .woff2 | Yes | Yes |
| EOT | .eot | Yes | Yes |