FontRepository

FontRepository

Overview

FontRepository is a class in Aspose.PDF FOSS for Python.

Aggregate font sources and resolve fonts by name.

This class provides 8 methods for working with FontRepository objects in Python programs. Available methods include: add_source, clear_sources, find_font, get_available_fonts, get_sources, open_font, reset_sources, search. All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.

Methods

SignatureDescription
add_source(source: FontSource)Register source; sources are queried highest-priority first.
clear_sources()Remove all registered sources (including the system source).
reset_sources()Restore the default source list (system fonts only).
get_sources()list[FontSource]Return the registered sources in query order.
get_available_fonts()list[FontDescriptor]Return all discoverable fonts, de-duplicated across sources.
find_font(font_name: str)FontDescriptor | NoneResolve font_name against registered sources, then standards.
search(font_name: str)FontDescriptor | NoneCalls search(font_name) on this FontRepository instance.
open_font(font_name: str)bytes | NoneReturn embeddable font bytes for font_name, or None.

See Also