Pango.AttrIterator¶
Fields¶
None
Methods¶
| copy() | |
| destroy() | |
| get(type) | |
| get_attrs() | |
| get_font(desc, language, extra_attrs) | |
| next() | |
| range() | 
Details¶
- 
class Pango.AttrIterator¶
- The - Pango.AttrIteratorstructure is used to represent an iterator through a- Pango.AttrList. A new iterator is created with- Pango.AttrList.get_iterator(). Once the iterator is created, it can be advanced through the style changes in the text using- Pango.AttrIterator.next(). At each style change, the range of the current style segment and the attributes currently in effect can be queried.- 
copy()[source]¶
- Returns: - the newly allocated - Pango.AttrIterator, which should be freed with- Pango.AttrIterator.destroy().- Return type: - Pango.AttrIterator- Copy a - Pango.AttrIterator
 - 
destroy()[source]¶
- Destroy a - Pango.AttrIteratorand free all associated memory.
 - 
get(type)[source]¶
- Parameters: - type ( - Pango.AttrType) – the type of attribute to find.- Returns: - the current attribute of the given type, or - Noneif no attribute of that type applies to the current location.- Return type: - Pango.Attributeor- None- Find the current attribute of a particular type at the iterator location. When multiple attributes of the same type overlap, the attribute whose range starts closest to the current location is used. 
 - 
get_attrs()[source]¶
- Returns: - a list of all attributes for the current range. To free this value, call - Pango.Attribute.destroy() on each value and g_slist_free() on the list.- Return type: - [ - Pango.Attribute]- Gets a list of all attributes at the current position of the iterator. - New in version 1.2. 
 - 
get_font(desc, language, extra_attrs)[source]¶
- Parameters: - desc (Pango.FontDescription) – aPango.FontDescriptionto fill in with the current values. The family name in this structure will be set usingPango.FontDescription.set_family_static() using values from an attribute in thePango.AttrListassociated with the iterator, so if you plan to keep it around, you must call:pango_font_description_set_family (desc, pango_font_description_get_family (desc)).
- language (Pango.LanguageorNone) – if non-None, location to store language tag for item, orNoneif none is found.
- extra_attrs ([Pango.Attribute] orNone) – if non-None, location in which to store a list of non-font attributes at the the current position; only the highest priority value of each attribute will be added to this list. In order to free this value, you must callPango.Attribute.destroy() on each member.
 - Get the font and other attributes at the current iterator position. 
- desc (
 - 
next()[source]¶
- Returns: - Falseif the iterator is at the end of the list, otherwise- True- Return type: - bool- Advance the iterator until the next change of style. 
 - 
range()[source]¶
- Returns: - start: - location to store the start of the range - end: - location to store the end of the range - Return type: - (start: - int, end:- int)- Get the range of the current segment. Note that the stored return values are signed, not unsigned like the values in - Pango.Attribute. To deal with this API oversight, stored return values that wouldn’t fit into a signed integer are clamped to- GObject.G_MAXINT.
 
-