:right-sidebar: True FontFamily =================================================================== .. currentmodule:: gi.repository.Pango .. class:: FontFamily(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.ListModel` A ``PangoFontFamily`` is used to represent a family of related font faces. The font faces in a family share a common design, but differ in slant, weight, width or other aspects. Methods ------- .. rst-class:: interim-class .. class:: FontFamily :no-index: .. method:: do_get_face(self, name: str | None = None) -> ~gi.repository.Pango.FontFace | None :param name: .. method:: do_get_name(self) -> str .. method:: do_is_monospace(self) -> bool .. method:: do_is_variable(self) -> bool .. method:: do_list_faces(self) -> list[~gi.repository.Pango.FontFace] .. method:: get_face(name: str | None = None) -> ~gi.repository.Pango.FontFace | None Gets the ``PangoFontFace`` of ``family`` with the given name. .. versionadded:: 1.46 :param name: the name of a face. If the name is :const:`None`, the family's default face (fontconfig calls it "Regular") will be returned. .. method:: get_name() -> str Gets the name of the family. The name is unique among all fonts for the font backend and can be used in a ``PangoFontDescription`` to specify that a face from this family is desired. .. method:: is_monospace() -> bool A monospace font is a font designed for text display where the the characters form a regular grid. For Western languages this would mean that the advance width of all characters are the same, but this categorization also includes Asian fonts which include double-width characters: characters that occupy two grid cells. :func:`~gi.repository.GLib.unichar_iswide` returns a result that indicates whether a character is typically double-width in a monospace font. The best way to find out the grid-cell size is to call :obj:`~gi.repository.Pango.FontMetrics.get_approximate_digit_width`\, since the results of :obj:`~gi.repository.Pango.FontMetrics.get_approximate_char_width` may be affected by double-width characters. .. versionadded:: 1.4 .. method:: is_variable() -> bool A variable font is a font which has axes that can be modified to produce different faces. Such axes are also known as *variations*\; see :obj:`~gi.repository.Pango.FontDescription.set_variations` for more information. .. versionadded:: 1.44 .. method:: list_faces() -> list[~gi.repository.Pango.FontFace] Lists the different font faces that make up ``family``\. The faces in a family share a common design, but differ in slant, weight, width and other aspects. Note that the returned faces are not in any particular order, and multiple faces may have the same name or characteristics. ``PangoFontFamily`` also implemented the :obj:`~gi.repository.Gio.ListModel` interface for enumerating faces. Properties ---------- .. rst-class:: interim-class .. class:: FontFamily :no-index: .. attribute:: props.is_monospace :type: bool The type of the None singleton. .. versionadded:: 1.52 .. attribute:: props.is_variable :type: bool The type of the None singleton. .. versionadded:: 1.52 .. attribute:: props.item_type :type: ~gobject.GType The type of the None singleton. .. attribute:: props.n_items :type: int The type of the None singleton. .. attribute:: props.name :type: str The type of the None singleton. .. versionadded:: 1.52 Virtual Methods --------------- .. rst-class:: interim-class .. class:: FontFamily :no-index: .. method:: do_get_face(name: str | None = None) -> ~gi.repository.Pango.FontFace | None Gets the ``PangoFontFace`` of ``family`` with the given name. .. versionadded:: 1.46 :param name: the name of a face. If the name is :const:`None`, the family's default face (fontconfig calls it "Regular") will be returned. .. method:: do_get_name() -> str Gets the name of the family. The name is unique among all fonts for the font backend and can be used in a ``PangoFontDescription`` to specify that a face from this family is desired. .. method:: do_is_monospace() -> bool A monospace font is a font designed for text display where the the characters form a regular grid. For Western languages this would mean that the advance width of all characters are the same, but this categorization also includes Asian fonts which include double-width characters: characters that occupy two grid cells. :func:`~gi.repository.GLib.unichar_iswide` returns a result that indicates whether a character is typically double-width in a monospace font. The best way to find out the grid-cell size is to call :obj:`~gi.repository.Pango.FontMetrics.get_approximate_digit_width`\, since the results of :obj:`~gi.repository.Pango.FontMetrics.get_approximate_char_width` may be affected by double-width characters. .. versionadded:: 1.4 .. method:: do_is_variable() -> bool A variable font is a font which has axes that can be modified to produce different faces. Such axes are also known as *variations*\; see :obj:`~gi.repository.Pango.FontDescription.set_variations` for more information. .. versionadded:: 1.44 .. method:: do_list_faces() -> list[~gi.repository.Pango.FontFace] Lists the different font faces that make up ``family``\. The faces in a family share a common design, but differ in slant, weight, width and other aspects. Note that the returned faces are not in any particular order, and multiple faces may have the same name or characteristics. ``PangoFontFamily`` also implemented the :obj:`~gi.repository.Gio.ListModel` interface for enumerating faces. Fields ------ .. rst-class:: interim-class .. class:: FontFamily :no-index: .. attribute:: parent_instance