:right-sidebar: True Font =================================================================== .. currentmodule:: gi.repository.PangoFc .. class:: Font(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Pango.Font`, :class:`~gi.repository.GObject.Object` ``PangoFcFont`` is a base class for font implementations using the Fontconfig and FreeType libraries. It is used in onjunction with :obj:`~gi.repository.PangoFc.FontMap`\. When deriving from this class, you need to implement all of its virtual functions other than shutdown() along with the get_glyph_extents() virtual function from ``PangoFont``\. Methods ------- .. rst-class:: interim-class .. class:: Font :no-index: .. classmethod:: description_from_pattern(include_size: bool) -> ~gi.repository.Pango.FontDescription Creates a ``PangoFontDescription`` that matches the specified Fontconfig pattern as closely as possible. Many possible Fontconfig pattern values, such as %FC_RASTERIZER or %FC_DPI, don't make sense in the context of ``PangoFontDescription``\, so will be ignored. .. versionadded:: 1.4 :param include_size: if :const:`True`, the pattern will include the size from the ``pattern``\; otherwise the resulting pattern will be unsized. (only %FC_SIZE is examined, not %FC_PIXEL_SIZE) .. method:: get_glyph(wc: str) -> int Gets the glyph index for a given Unicode character for ``font``\. If you only want to determine whether the font has the glyph, use :obj:`~gi.repository.PangoFc.Font.has_char`\. .. versionadded:: 1.4 :param wc: Unicode character to look up .. method:: get_languages() -> list[~gi.repository.Pango.Language] | None Returns the languages that are supported by ``font``\. This corresponds to the FC_LANG member of the FcPattern. The returned array is only valid as long as the font and its fontmap are valid. .. versionadded:: 1.48 .. deprecated:: 1.50 Use pango_font_get_language() .. method:: get_unknown_glyph(wc: str) -> int Returns the index of a glyph suitable for drawing ``wc`` as an unknown character. Use :func:`~gi.repository.Pango.GET_UNKNOWN_GLYPH` instead. .. versionadded:: 1.4 :param wc: the Unicode character for which a glyph is needed. .. method:: has_char(wc: str) -> bool Determines whether ``font`` has a glyph for the codepoint ``wc``\. .. versionadded:: 1.4 .. deprecated:: 1.44 Use :obj:`~gi.repository.Pango.Font.has_char` :param wc: Unicode codepoint to look up .. method:: kern_glyphs(glyphs: ~gi.repository.Pango.GlyphString) -> None This function used to adjust each adjacent pair of glyphs in ``glyphs`` according to kerning information in ``font``\. Since 1.44, it does nothing. .. versionadded:: 1.4 .. deprecated:: 1.32 Please do not use it in newly written code :param glyphs: a ``PangoGlyphString`` .. method:: unlock_face() -> None Releases a font previously obtained with :obj:`~gi.repository.PangoFc.Font.lock_face`\. .. versionadded:: 1.4 .. deprecated:: 1.44 Use :func:`~gi.repository.Pango.Pango.Font.get_hb_font` instead Properties ---------- .. rst-class:: interim-class .. class:: Font :no-index: .. attribute:: props.fontmap :type: ~gi.repository.PangoFc.FontMap The PangoFc font map this font is associated with. .. attribute:: props.pattern :type: ~typing.Any The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: Font :no-index: .. attribute:: description .. attribute:: font_pattern .. attribute:: fontmap .. attribute:: is_hinted .. attribute:: is_transformed .. attribute:: matrix .. attribute:: metrics_by_lang .. attribute:: parent_instance .. attribute:: priv