:right-sidebar: True AttrType =================================================================== .. currentmodule:: gi.repository.Pango .. class:: AttrType :no-contents-entry: The ``PangoAttrType`` distinguishes between different types of attributes. Along with the predefined values, it is possible to allocate additional values for custom attributes using :obj:`~gi.repository.AttrType.register`. The predefined values are given below. The type of structure used to store the attribute is listed in parentheses after the description. Methods ------- .. rst-class:: interim-class .. class:: AttrType :no-index: .. method:: get_name(type: ~gi.repository.Pango.AttrType) -> str | None Fetches the attribute type name. The attribute type name is the string passed in when registering the type using :obj:`~gi.repository.Pango.AttrType.register`. The returned value is an interned string (see :func:`~gi.repository.GLib.intern_string` for what that means) that should not be modified or freed. .. versionadded:: 1.22 :param type: an attribute type ID to fetch the name for .. method:: register(name: str) -> ~gi.repository.Pango.AttrType Allocate a new attribute type ID. The attribute type name can be accessed later by using :obj:`~gi.repository.Pango.AttrType.get_name`. :param name: an identifier for the type Fields ------ .. rst-class:: interim-class .. class:: AttrType :no-index: .. attribute:: ABSOLUTE_LINE_HEIGHT Line height (:obj:`~gi.repository.Pango.AttrInt`). Since: 1.50 .. attribute:: ABSOLUTE_SIZE Font size in pixels scaled by :const:`~gi.repository.Pango.SCALE` (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: ALLOW_BREAKS Whether breaks are allowed (:obj:`~gi.repository.Pango.AttrInt`). Since 1.44 .. attribute:: BACKGROUND Background color (:obj:`~gi.repository.Pango.AttrColor`) .. attribute:: BACKGROUND_ALPHA Background alpha (:obj:`~gi.repository.Pango.AttrInt`). Since 1.38 .. attribute:: BASELINE_SHIFT Baseline displacement (:obj:`~gi.repository.Pango.AttrInt`). Since 1.50 .. attribute:: FALLBACK Whether fallback is enabled (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: FAMILY Font family name list (:obj:`~gi.repository.Pango.AttrString`) .. attribute:: FONT_DESC Font description (:obj:`~gi.repository.Pango.AttrFontDesc`) .. attribute:: FONT_FEATURES OpenType font features (:obj:`~gi.repository.Pango.AttrFontFeatures`). Since 1.38 .. attribute:: FONT_SCALE Font-relative size change (:obj:`~gi.repository.Pango.AttrInt`). Since 1.50 .. attribute:: FOREGROUND Foreground color (:obj:`~gi.repository.Pango.AttrColor`) .. attribute:: FOREGROUND_ALPHA Foreground alpha (:obj:`~gi.repository.Pango.AttrInt`). Since 1.38 .. attribute:: GRAVITY Base text gravity (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: GRAVITY_HINT Gravity hint (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: INSERT_HYPHENS Whether to insert hyphens at intra-word line breaks (:obj:`~gi.repository.Pango.AttrInt`). Since 1.44 .. attribute:: INVALID Does not happen .. attribute:: LANGUAGE Language (:obj:`~gi.repository.Pango.AttrLanguage`) .. attribute:: LETTER_SPACING Letter spacing (:obj:`~gi.repository.Pango.PangoAttrInt`) .. attribute:: LINE_HEIGHT Line height factor (:obj:`~gi.repository.Pango.AttrFloat`). Since: 1.50 .. attribute:: OVERLINE Whether the text has an overline (:obj:`~gi.repository.Pango.AttrInt`). Since 1.46 .. attribute:: OVERLINE_COLOR Overline color (:obj:`~gi.repository.Pango.AttrColor`). Since 1.46 .. attribute:: RISE Baseline displacement (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: SCALE Font size scale factor (:obj:`~gi.repository.Pango.AttrFloat`) .. attribute:: SENTENCE Override segmentation to classify the range of the attribute as a single sentence (:obj:`~gi.repository.Pango.AttrInt`). Since 1.50 .. attribute:: SHAPE Shape (:obj:`~gi.repository.Pango.AttrShape`) .. attribute:: SHOW How to render invisible characters (:obj:`~gi.repository.Pango.AttrInt`). Since 1.44 .. attribute:: SIZE Font size in points scaled by :const:`~gi.repository.Pango.SCALE` (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: STRETCH Font stretch (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: STRIKETHROUGH Whether the text is struck-through (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: STRIKETHROUGH_COLOR Strikethrough color (:obj:`~gi.repository.Pango.AttrColor`) .. attribute:: STYLE Font slant style (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: TEXT_TRANSFORM .. attribute:: UNDERLINE Whether the text has an underline (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: UNDERLINE_COLOR Underline color (:obj:`~gi.repository.Pango.AttrColor`) .. attribute:: VARIANT Font variant (normal or small caps) (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: WEIGHT Font weight (:obj:`~gi.repository.Pango.AttrInt`) .. attribute:: WORD Override segmentation to classify the range of the attribute as a single word (:obj:`~gi.repository.Pango.AttrInt`). Since 1.50