:right-sidebar: True FontMap =================================================================== .. currentmodule:: gi.repository.PangoFT2 .. class:: FontMap(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.PangoFc.FontMap`, :class:`~gi.repository.Pango.FontMap`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.ListModel` The ``PangoFT2FontMap`` is the ``PangoFontMap`` implementation for FreeType fonts. Constructors ------------ .. rst-class:: interim-class .. class:: FontMap :no-index: .. classmethod:: new() -> ~gi.repository.Pango.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 :obj:`~gi.repository.PangoFT2.FontMap.set_default_substitute`\). .. versionadded:: 1.2 Methods ------- .. rst-class:: interim-class .. class:: FontMap :no-index: .. method:: set_default_substitute(func: ~typing.Callable[[~gi.repository.fontconfig.Pattern, ~typing.Any], None], data: ~typing.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. .. versionadded:: 1.2 .. deprecated:: 1.46 Use :obj:`~gi.repository.PangoFc.FontMap.set_default_substitute` instead. :param func: function to call to to do final config tweaking on :obj:`~gi.repository.fontconfig.Pattern` objects. :param data: data to pass to ``func`` .. method:: set_resolution(dpi_x: float, dpi_y: float) -> None Sets the horizontal and vertical resolutions for the fontmap. .. versionadded:: 1.2 :param dpi_x: dots per inch in the X direction :param dpi_y: dots per inch in the Y direction .. method:: substitute_changed() -> None Call this function any time the results of the default substitution function set with :func:`~gi.repository.PangoFT2.FontMap.set_default_substitute` change. That is, if your substitution function will return different results for the same input pattern, you must call this function. .. versionadded:: 1.2 .. deprecated:: 1.46 Use :obj:`~gi.repository.PangoFc.FontMap.substitute_changed` instead.