pango.LayoutIter an object used to iterate over the visual extents of a pango.Layout (new in PyGTK 2.6) Synopsis pango.LayoutIter gobject.GBoxed free next_char next_cluster next_line next_run at_last_line get_index get_baseline get_char_extents get_cluster_extents get_layout_extents get_line_extents get_run_extents get_line_yrange get_line Ancestry +-- gobject.GBoxed +-- pango.LayoutIter Description A pango.LayoutIter object can be used to iterate over the visual elements of a pango.Layout. A pango.LayoutIter is created using the pango.Layout.get_iter() method. Methods pango.LayoutIter.free free Returns : a new pango.Layout that is a copy of the layout This method is deprecated and should not be used since it may crash your application. The free() method frees the pango.LayoutIter object. pango.LayoutIter.next_char next_char Returns : True if the iter was moved. The next_char() method returns True if the pango.LayoutIter is moved to the next character in visual order. If the iter was already at the end of the layout this method returns False. pango.LayoutIter.next_cluster next_cluster Returns : True if the iter was moved. The next_cluster() method returns True if the pango.LayoutIter is moved to the next cluster in visual order. If the iter was already at the end of the layout this method returns False. pango.LayoutIter.next_line next_line Returns : True if the iter was moved. The next_line() method returns True if the pango.LayoutIter is moved to the next line in visual order. If the iter was already at the end of the layout this method returns False. pango.LayoutIter.next_run next_run Returns : True if the iter was moved. The next_run() method returns True if the pango.LayoutIter is moved to the next run in visual order. If the iter was already at the end of the layout this method returns False. pango.LayoutIter.at_last_line at_last_line Returns : True if the iter is in the last line. The at_last_line() method returns True if the pango.LayoutIter points to a position in the last line of the layout. pango.LayoutIter.get_index get_index Returns : the current byte index The get_index() method returns the current byte index. Note that iterating forward by char moves 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. pango.LayoutIter.get_baseline get_baseline Returns : the baseline of the current line. The get_baseline() method returns the y position of the current line's baseline, in layout coordinates (origin at top left of the entire layout). pango.LayoutIter.get_char_extents get_char_extents Returns : a 4-tuple containing the logical extents of the character at the iter position. The get_char_extents() method returns a 4-tuple (x, y, width, height) containing the logical 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. pango.LayoutIter.get_cluster_extents get_cluster_extents Returns : a 2-tuple containing containing the ink and logical extents as 4-tuples. The get_cluster_extents() method returns a 2-tuple containing the ink and logical extents (as 4-tuples: x, y, width, height) of the cluster at the iter position. pango.LayoutIter.get_layout_extents get_layout_extents Returns : a 2-tuple containing containing the ink and logical extents as 4-tuples. The get_layout_extents() method returns a 2-tuple containing the ink and logical extents (as 4-tuples: x, y, width, height) of the layout at the iter position. pango.LayoutIter.get_line_extents get_line_extents Returns : a 2-tuple containing containing the ink and logical extents as 4-tuples. The get_line_extents() method returns a 2-tuple containing the ink and logical extents (as 4-tuples: x, y, width, height) of the line at the iter position. pango.LayoutIter.get_run_extents get_run_extents Returns : a 2-tuple containing containing the ink and logical extents as 4-tuples. The get_run_extents() method returns a 2-tuple containing the ink and logical extents (as 4-tuples: x, y, width, height) of the run at the iter position. pango.LayoutIter.get_line_yrange get_line_yrange Returns : a 2-tuple containing the start and end of the layout line. The get_line_yrange() method returns a 2-tuple containing the start and end y positions of the layout line. The vertical space in the pango.Layout associated with the iter is devided between the lines in the layout, the space belonging to the current line is returned in the 2-tuple. A line's range includes the line's logical extents, plus half of the spacing above and below the line, if the pango.Layout.set_spacing() method has been called to set the layout spacing. The y positions are in layout coordinates (origin at top left of the entire layout). pango.LayoutIter.get_line get_line Returns : a pango.LayoutLine containing the current line. This method is available in PyGTK 2.8 and above. The get_line() method returns a pango.LayoutLine containing the current line.