:right-sidebar: True AttrShape =================================================================== .. currentmodule:: gi.repository.Pango .. class:: AttrShape(*args, **kwargs) :no-contents-entry: The ``PangoAttrShape`` structure is used to represent attributes which impose shape restrictions. Methods ------- .. rst-class:: interim-class .. class:: AttrShape :no-index: .. classmethod:: new(logical_rect: ~gi.repository.Pango.Rectangle) -> ~gi.repository.Pango.Attribute Create a new shape attribute. A shape is used to impose a particular ink and logical rectangle on the result of shaping a particular glyph. This might be used, for instance, for embedding a picture or a widget inside a ``PangoLayout``\. :param logical_rect: logical rectangle to assign to each character .. classmethod:: new_with_data(logical_rect: ~gi.repository.Pango.Rectangle, data: ~typing.Any = None, copy_func: ~typing.Callable[[~typing.Any], ~typing.Any | None] | None = None) -> ~gi.repository.Pango.Attribute Creates a new shape attribute. Like :obj:`~gi.repository.Pango.AttrShape.new`\, but a user data pointer is also provided; this pointer can be accessed when later rendering the glyph. .. versionadded:: 1.8 :param logical_rect: logical rectangle to assign to each character :param data: user data pointer :param copy_func: function to copy ``data`` when the attribute is copied. If :const:`None`, ``data`` is simply copied as a pointer Fields ------ .. rst-class:: interim-class .. class:: AttrShape :no-index: .. attribute:: attr The common portion of the attribute .. attribute:: copy_func Copy function for the user data .. attribute:: data User data set (see :obj:`~gi.repository.Pango.AttrShape.new_with_data`\) .. attribute:: destroy_func Destroy function for the user data .. attribute:: ink_rect The ink rectangle to restrict to .. attribute:: logical_rect The logical rectangle to restrict to