:right-sidebar: True Attribute =================================================================== .. currentmodule:: gi.repository.Pango .. class:: Attribute(*args, **kwargs) :no-contents-entry: :Constructors: :: Attribute() Methods ------- .. rst-class:: interim-class .. class:: Attribute :no-index: .. method:: as_color() -> ~gi.repository.Pango.AttrColor | None Returns the attribute cast to ``PangoAttrColor``. This is mainly useful for language bindings. .. versionadded:: 1.50 .. method:: as_float() -> ~gi.repository.Pango.AttrFloat | None Returns the attribute cast to ``PangoAttrFloat``. This is mainly useful for language bindings. .. versionadded:: 1.50 .. method:: as_font_desc() -> ~gi.repository.Pango.AttrFontDesc | None Returns the attribute cast to ``PangoAttrFontDesc``. This is mainly useful for language bindings. .. versionadded:: 1.50 .. method:: as_font_features() -> ~gi.repository.Pango.AttrFontFeatures | None Returns the attribute cast to ``PangoAttrFontFeatures``. This is mainly useful for language bindings. .. versionadded:: 1.50 .. method:: as_int() -> ~gi.repository.Pango.AttrInt | None Returns the attribute cast to ``PangoAttrInt``. This is mainly useful for language bindings. .. versionadded:: 1.50 .. method:: as_language() -> ~gi.repository.Pango.AttrLanguage | None Returns the attribute cast to ``PangoAttrLanguage``. This is mainly useful for language bindings. .. versionadded:: 1.50 .. method:: as_shape() -> ~gi.repository.Pango.AttrShape | None Returns the attribute cast to ``PangoAttrShape``. This is mainly useful for language bindings. .. versionadded:: 1.50 .. method:: as_size() -> ~gi.repository.Pango.AttrSize | None Returns the attribute cast to ``PangoAttrSize``. This is mainly useful for language bindings. .. versionadded:: 1.50 .. method:: as_string() -> ~gi.repository.Pango.AttrString | None Returns the attribute cast to ``PangoAttrString``. This is mainly useful for language bindings. .. versionadded:: 1.50 .. method:: destroy() -> None Destroy a ``PangoAttribute`` and free all associated memory. .. method:: equal(attr2: ~gi.repository.Pango.Attribute) -> bool Compare two attributes for equality. This compares only the actual value of the two attributes and not the ranges that the attributes apply to. :param attr2: another ``PangoAttribute`` .. method:: init(klass: ~gi.repository.Pango.AttrClass) -> None Initializes ``attr``'s klass to ``klass``, it's start_index to :const:`~gi.repository.Pango.ATTR_INDEX_FROM_TEXT_BEGINNING` and end_index to :const:`~gi.repository.Pango.ATTR_INDEX_TO_TEXT_END` such that the attribute applies to the entire text by default. .. versionadded:: 1.20 :param klass: a ``PangoAttrClass`` Fields ------ .. rst-class:: interim-class .. class:: Attribute :no-index: .. attribute:: end_index End index of the range (in bytes). The character at this index is not included in the range. .. attribute:: klass The class structure holding information about the type of the attribute .. attribute:: start_index The start index of the range (in bytes).