:right-sidebar: True AttrShape =================================================================== .. currentmodule:: gi.repository.Pango .. class:: AttrShape(*args, **kwargs) :no-contents-entry: :Constructors: :: AttrShape() Methods ------- .. rst-class:: interim-class .. class:: AttrShape :no-index: .. method:: new(ink_rect: ~gi.repository.Pango.Rectangle, 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 ink_rect: ink rectangle to assign to each character :param logical_rect: logical rectangle to assign to each character .. method:: new_with_data(ink_rect: ~gi.repository.Pango.Rectangle, logical_rect: ~gi.repository.Pango.Rectangle, data: None, copy_func: ~typing.Callable[[...], None] | None = None, destroy_func: ~typing.Callable[[None], 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 ink_rect: ink rectangle to assign to each character :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 :param destroy_func: function to free ``data`` when the attribute is freed 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