pango.Layout
(new in PyGTK 2.6)
|
pango.Layout
(new in PyGTK 2.6)class pango.LayoutIter( |
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.
def 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.
def 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
.
def 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
.
def 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
.
def 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
.
def 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.
def 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.
def 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).
def 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.
def 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.
def 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.
def 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.
def 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.
def 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).
def 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.
© manpagez.com 2000-2024 Individual documents may contain additional copyright information.