FontMap#

class FontMap(**properties: Any)#

Superclasses: FontMap, FontMap, Object

Implemented Interfaces: ListModel

The PangoFT2FontMap is the PangoFontMap implementation for FreeType fonts.

Constructors#

class FontMap
classmethod new() FontMap#

Create a new PangoFT2FontMap object.

A fontmap is used to cache information about available fonts, and holds certain global parameters such as the resolution and the default substitute function (see set_default_substitute).

Added in version 1.2.

Methods#

class FontMap
set_default_substitute(func: Callable[[Pattern, Any], None], data: Any = None) None#

Sets a function that will be called to do final configuration substitution on a FcPattern before it is used to load the font.

This function can be used to do things like set hinting and antialiasing options.

Added in version 1.2.

Deprecated since version 1.46: Use set_default_substitute instead.

Parameters:
  • func – function to call to to do final config tweaking on Pattern objects.

  • data – data to pass to func

set_resolution(dpi_x: float, dpi_y: float) None#

Sets the horizontal and vertical resolutions for the fontmap.

Added in version 1.2.

Parameters:
  • dpi_x – dots per inch in the X direction

  • dpi_y – dots per inch in the Y direction

substitute_changed() None#

Call this function any time the results of the default substitution function set with set_default_substitute() change.

That is, if your substitution function will return different results for the same input pattern, you must call this function.

Added in version 1.2.

Deprecated since version 1.46: Use substitute_changed instead.