Pango.LayoutIter¶
Fields¶
None
Methods¶
| at_last_line() | |
| copy() | |
| free() | |
| get_baseline() | |
| get_char_extents() | |
| get_cluster_extents() | |
| get_index() | |
| get_layout() | |
| get_layout_extents() | |
| get_line() | |
| get_line_extents() | |
| get_line_readonly() | |
| get_line_yrange() | |
| get_run() | |
| get_run_extents() | |
| get_run_readonly() | |
| next_char() | |
| next_cluster() | |
| next_line() | |
| next_run() | 
Details¶
- 
class Pango.LayoutIter¶
- A - Pango.LayoutIterstructure can be used to iterate over the visual extents of a- Pango.Layout.- The - Pango.LayoutIterstructure is opaque, and has no user-visible fields.- 
at_last_line()[source]¶
- Returns: - Trueif self is on the last line.- Return type: - bool- Determines whether self is on the last line of the layout. 
 - 
copy()[source]¶
- Returns: - the newly allocated - Pango.LayoutIter, which should be freed with- Pango.LayoutIter.free(), or- Noneif self was- None.- Return type: - Pango.LayoutIteror- None- Copies a - Pango.LayoutIter.- New in version 1.20. 
 - 
get_baseline()[source]¶
- Returns: - baseline of current line. - Return type: - int- Gets the Y position of the current line’s baseline, in layout coordinates (origin at top left of the entire layout). 
 - 
get_char_extents()[source]¶
- Returns: - rectangle to fill with logical extents - Return type: - logical_rect: - Pango.Rectangle- Gets the extents of the current character, in layout coordinates (origin is the top left of the entire layout). Only logical extents can sensibly be obtained for characters; ink extents make sense only down to the level of clusters. 
 - 
get_cluster_extents()[source]¶
- Returns: - ink_rect: - rectangle to fill with ink extents, or - None- logical_rect: - rectangle to fill with logical extents, or - None- Return type: - (ink_rect: - Pango.Rectangle, logical_rect:- Pango.Rectangle)- Gets the extents of the current cluster, in layout coordinates (origin is the top left of the entire layout). 
 - 
get_index()[source]¶
- Returns: - current byte index. - Return type: - int- Gets the current byte index. Note that iterating forward by - strmoves in visual order, not logical order, so indexes may not be sequential. Also, the index may be equal to the length of the text in the layout, if on the- Nonerun (see- Pango.LayoutIter.get_run()).
 - 
get_layout()[source]¶
- Returns: - the layout associated with self. - Return type: - Pango.Layout- Gets the layout associated with a - Pango.LayoutIter.- New in version 1.20. 
 - 
get_layout_extents()[source]¶
- Returns: - ink_rect: - rectangle to fill with ink extents, or - None- logical_rect: - rectangle to fill with logical extents, or - None- Return type: - (ink_rect: - Pango.Rectangle, logical_rect:- Pango.Rectangle)- Obtains the extents of the - Pango.Layoutbeing iterated over. ink_rect or logical_rect can be- Noneif you aren’t interested in them.
 - 
get_line()[source]¶
- Returns: - the current line. - Return type: - Pango.LayoutLine- Gets the current line. - Use the faster - Pango.LayoutIter.get_line_readonly() if you do not plan to modify the contents of the line (glyphs, glyph widths, etc.).
 - 
get_line_extents()[source]¶
- Returns: - ink_rect: - rectangle to fill with ink extents, or - None- logical_rect: - rectangle to fill with logical extents, or - None- Return type: - (ink_rect: - Pango.Rectangle, logical_rect:- Pango.Rectangle)- Obtains the extents of the current line. ink_rect or logical_rect can be - Noneif you aren’t interested in them. Extents are in layout coordinates (origin is the top-left corner of the entire- Pango.Layout). Thus the extents returned by this function will be the same width/height but not at the same x/y as the extents returned from- Pango.LayoutLine.get_extents().
 - 
get_line_readonly()[source]¶
- Returns: - the current line, that should not be modified. - Return type: - Pango.LayoutLine- Gets the current line for read-only access. - This is a faster alternative to - Pango.LayoutIter.get_line(), but the user is not expected to modify the contents of the line (glyphs, glyph widths, etc.).- New in version 1.16. 
 - 
get_line_yrange()[source]¶
- Returns: - y0_: - start of line, or - None- y1_: - end of line, or - None- Return type: - (y0_: - int, y1_:- int)- Divides the vertical space in the - Pango.Layoutbeing iterated over between the lines in the layout, and returns the space belonging to the current line. A line’s range includes the line’s logical extents, plus half of the spacing above and below the line, if- Pango.Layout.set_spacing() has been called to set layout spacing. The Y positions are in layout coordinates (origin at top left of the entire layout).- Note: Since 1.44, Pango uses line heights for placing lines, and there may be gaps between the ranges returned by this function. 
 - 
get_run()[source]¶
- Returns: - the current run. - Return type: - Pango.GlyphItemor- None- Gets the current run. When iterating by run, at the end of each line, there’s a position with a - Nonerun, so this function can return- None. The- Nonerun at the end of each line ensures that all lines have at least one run, even lines consisting of only a newline.- Use the faster - Pango.LayoutIter.get_run_readonly() if you do not plan to modify the contents of the run (glyphs, glyph widths, etc.).
 - 
get_run_extents()[source]¶
- Returns: - ink_rect: - rectangle to fill with ink extents, or - None- logical_rect: - rectangle to fill with logical extents, or - None- Return type: - (ink_rect: - Pango.Rectangle, logical_rect:- Pango.Rectangle)- Gets the extents of the current run in layout coordinates (origin is the top left of the entire layout). 
 - 
get_run_readonly()[source]¶
- Returns: - the current run, that should not be modified. - Return type: - Pango.GlyphItemor- None- Gets the current run. When iterating by run, at the end of each line, there’s a position with a - Nonerun, so this function can return- None. The- Nonerun at the end of each line ensures that all lines have at least one run, even lines consisting of only a newline.- This is a faster alternative to - Pango.LayoutIter.get_run(), but the user is not expected to modify the contents of the run (glyphs, glyph widths, etc.).- New in version 1.16. 
 - 
next_char()[source]¶
- Returns: - whether motion was possible. - Return type: - bool- Moves self forward to the next character in visual order. If self was already at the end of the layout, returns - False.
 - 
next_cluster()[source]¶
- Returns: - whether motion was possible. - Return type: - bool- Moves self forward to the next cluster in visual order. If self was already at the end of the layout, returns - False.
 
-