A Pango::LayoutLine represents one of the lines resulting from laying out a paragraph via Pango::Layout.
Pango::LayoutLine objects are obtained by calling Pango::Layout::get_line() and are only valid until the text, attributes, or settings of the parent Pango::Layout are modified. Routines for rendering Pango::Layout objects are provided in code specific to each rendering system.
Compute the logical and ink extents of a layout line.
See the documentation for Pango::Font::get_glyph_extents() for details about the interpretation of the rectangles. The returned rectangles are in device units, as opposed to pango_layout_line_get_extents(), which returns the extents in units of device unit / PANGO_SCALE.
Parameters:
ink_rect
Rectangle used to store the extents of the glyph string as drawn or 0 to indicate that the result is not needed.
logical_rect
Rectangle used to store the logical extents of the glyph string or 0 to indicate that the result is not needed.
Get a list of visual ranges corresponding to a given logical range.
This list is not necessarily minimal - there may be consecutive ranges which are adjacent. The ranges will be sorted from left to right. The ranges are with respect to the left edge of the entire layout, not with respect to the line.
Parameters:
start_index
The start byte index of the logical range. If the value of start_index is less than the start index for the line, then the first range will extend all the way to the leading edge of the layout. Otherwise it will start at the leading edge of the first character.
end_index
The end byte index of the logical range. If the value of end_index is greater than the end index for the line, then the last range will extend all the way to the trailing edge of the layout. Otherwise, it will end at the trailing edge of the last character.
Returns:
An array of ranges represented by pairs of integers marking the start and end pixel coordinates of the ranges.
const PangoLayoutLine* Pango::LayoutLine::gobj
(
)
const
PangoLayoutLine* Pango::LayoutLine::gobj
(
)
PangoLayoutLine* Pango::LayoutLine::gobj_copy
(
)
const
int Pango::LayoutLine::index_to_x
(
int
index,
bool
trailing
)
const
Converts an index within a line to a x position.
Parameters:
index
Byte offset of a grapheme within the layout.
trailing
An boolean indicating the edge of the grapheme to retrieve the position of. If false, the trailing edge of the grapheme, if true the leading of the grapheme.
Returns:
The x offset (in thousands of a device unit).
void Pango::LayoutLine::operator delete
(
void*
,
size_t
)
[protected]
void Pango::LayoutLine::reference
(
)
const
void Pango::LayoutLine::unreference
(
)
const
bool Pango::LayoutLine::x_to_index
(
int
x_pos,
int&
index,
int&
trailing
)
const
Convert from x offset to the byte index of the corresponding character within the text of the layout.
If x_pos is outside the line, the start or end of the line will be stored at index .
Parameters:
x_pos
The x offset (in thousands of a device unit) from the left edge of the line.
index_
Location to store calculated byte offset for the grapheme in which the user clicked.
trailing
Location to store a integer indicating where in the grapheme the user clicked. It will either be zero, or the number of characters in the grapheme. 0 represents the trailing edge of the cluster.
Returns:
false if x_pos was outside the line, true if inside.