AttrShape#

class AttrShape(*args, **kwargs)#

The PangoAttrShape structure is used to represent attributes which impose shape restrictions.

Methods#

class AttrShape
classmethod new(logical_rect: Rectangle) 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.

Parameters:

logical_rect – logical rectangle to assign to each character

classmethod new_with_data(logical_rect: Rectangle, data: Any = None, copy_func: Callable[[Any], Any | None] | None = None) Attribute#

Creates a new shape attribute.

Like new, but a user data pointer is also provided; this pointer can be accessed when later rendering the glyph.

Added in version 1.8.

Parameters:
  • logical_rect – logical rectangle to assign to each character

  • data – user data pointer

  • copy_func – function to copy data when the attribute is copied. If None, data is simply copied as a pointer

Fields#

class AttrShape
attr#

The common portion of the attribute

copy_func#

Copy function for the user data

data#

User data set (see new_with_data)

destroy_func#

Destroy function for the user data

ink_rect#

The ink rectangle to restrict to

logical_rect#

The logical rectangle to restrict to