pango.LayoutLine
pango.LayoutLine — a line in a pango.Layout
(new in PyGTK 2.8)
Methods
pango.LayoutLine.get_extents
Returns : | a 2-tuple containing 4-tuples representing
the rectangles for the logical and ink extents in Pango
units. |
Note
This method is available in PyGTK 2.8 and above.
The get_extents() method returns the
logical and ink extents rectangles of the layout line in a 2-tuple
containing two 4-tuples which represent the rectangles. See the
documentation for the pango.Font.get_glyph_extents()
method for details about the interpretation of the rectangles. The return
extents are in Pango units (1 device unit = pango.SCALE pango units).
pango.LayoutLine.get_pixel_extents
Returns : | a 2-tuple containing 4-tuples representing
the rectangles for the logical and ink extents in device
units. |
Note
This method is available in PyGTK 2.8 and above.
The get_pixel_extents() method returns
the logical and ink extents rectangles of the layout line in a 2-tuple
containing two 4-tuples which represent the rectangles. See the
documentation for the pango.Font.get_glyph_extents()
method for details about the interpretation of the rectangles. The return
extents are in device units (1 device unit = pango.SCALE pango
units).
pango.LayoutLine.index_to_x
def index_to_x(index, trailing)
|
index : | the byte offset of a grapheme
within the layout |
trailing : | an integer indicating the edge of the grapheme
to retrieve the position of. If 0, the trailing edge of the grapheme,
if > 0, the leading edge of the grapheme. |
Returns : | the X position in Pango units |
Note
This method is available in PyGTK 2.8 and above.
The index_to_x() method returns the X
position (in Pango units) of the grapheme at the byte offset specified by
index and edge specified by
trailing.
pango.LayoutLine.x_to_index
x_pos : | the x offset (in Pango units) from the left
edge of the line. |
Returns : | a 3-tuple containing a boolean indicating if the
x_pos is inside the line, the byte offset of the
grapheme and the location in the grapheme. |
Note
This method is available in PyGTK 2.8 and above.
The x_to_index() method returns a
3-tuple containing a boolean that is TRUE if x_pos is
inside the line, the location inside the grapheme - either zero, or the
number of characters in the grapheme. 0 represents the trailing edge of the
grapheme.