Frequently Asked Questions

Frequently Asked Questions

Licensing & Open Source

What is the licensing model?

Aspose.Font FOSS for Python is released under the MIT License. You can use, copy, modify, merge, publish, distribute, sublicense, or sell copies of the software without restriction. The only requirement is that the copyright notice and license text are included in all copies or substantial portions of the software.

Can I use it in commercial products?

Yes. The MIT license permits use in closed-source and commercial products. There are no royalty or attribution obligations beyond retaining the copyright header in your copies of the library itself.

Is there a paid version with more features?

Aspose.Font FOSS is the open-source edition. The FOSS edition covers TTF, OTF, CFF, Type 1, WOFF, WOFF2, and EOT — which covers the majority of real-world font work.


Installation & Requirements

How do I install Aspose.Font FOSS for Python?

Install the package from PyPI (requires Python 3.10+):

pip install "aspose-font>=1.0.0"

No system-level native dependencies are required.

What Python versions are supported?

Python 3.10 and later. The library uses standard library features only, so it works on CPython and PyPy implementations that support Python 3.10+.

Are there any native or platform dependencies?

No. Aspose.Font FOSS for Python has no C extensions, no system fonts, and no platform APIs. It works identically on Windows, macOS, and Linux.


Format Support

Which font formats can be read?

FontLoader.open() can load TTF, OTF, CFF (standalone), Type 1, WOFF, WOFF2, and EOT.

from aspose_font.loader import FontLoader

font = FontLoader.open("MyFont.ttf")

Which formats can be written?

FontConverter.convert() supports conversion to TTF, CFF, WOFF, and WOFF2. The output font can be saved to bytes or a file stream.

Is WOFF2 decompression built-in?

Yes. WOFF2 Brotli compression and decompression are implemented entirely within the library. No external brotli package is required.


API Usage

How do I load a font and inspect its metadata?

Use FontLoader.open() which returns a Font instance. For TTF/OTF fonts cast to TtfFont to access TTF-specific properties:

from aspose_font.loader import FontLoader
from aspose_font.ttf.font import TtfFont

ttf_font: TtfFont = FontLoader.open("Roboto-Regular.ttf")
print(ttf_font.font_name)
print(ttf_font.num_glyphs)

How do I convert a TTF to WOFF2?

from aspose_font.loader import FontLoader
from aspose_font.converter import FontConverter
from aspose_font import FontType

font = FontLoader.open("Roboto-Regular.ttf")
woff2 = FontConverter.convert(font, FontType.WOFF2)

How do I subset a font for web delivery?

from aspose_font.loader import FontLoader
from aspose_font.subsetter import FontSubsetter

font = FontLoader.open("Roboto-Regular.ttf")
subset = FontSubsetter.subset_by_text(font, "Hello World")

How do I access individual glyphs?

Use Font.glyph_accessor which implements GlyphAccessor:

from aspose_font.loader import FontLoader

font = FontLoader.open("Roboto-Regular.ttf")
glyph = font.glyph_accessor.get_glyph_by_unicode(0x0041)  # 'A'
print(glyph.glyph_id)

Known Limitations

Is Font.to_bytes() implemented?

The abstract base class Font.to_bytes() raises NotImplementedError if called directly. However, all concrete font classes — TtfFont, CffFont, WoffFont, Woff2Font, EotFont, and Type1Font — implement to_bytes() fully. Load a font with FontLoader.open() and call to_bytes() on the returned concrete instance. FontConverter.convert() can also produce a new font in any supported target format.

Are all table types in TtfTableSet populated?

Only common tables (head, hhea, maxp, os2, name, post, cmap, loca, hmtx, kern) are exposed as named properties on TtfTableSet. Other tables can be read as raw bytes via TtfFont.get_table_bytes(tag).

Does the library support variable font instantiation?

Yes. TtfFont.instantiate() produces a static TtfFont at specified axis coordinates. Use TtfFont.is_variable and TtfFont.axes to detect variation axes first.