Struct pango::LayoutIter [−][src]
pub struct LayoutIter(_);
Expand description
A LayoutIter
structure can be used to
iterate over the visual extents of a Layout
.
The LayoutIter
structure is opaque, and
has no user-visible fields.
Implementations
Gets the Y position of the current line’s baseline, in layout coordinates (origin at top left of the entire layout).
Returns
baseline of current line.
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.
Returns
logical_rect
rectangle to fill with logical extents
Gets the extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).
Returns
ink_rect
rectangle to fill with ink extents, or None
logical_rect
rectangle to fill with logical extents, or None
Gets the current line.
Use the faster line_readonly()
if you do not plan
to modify the contents of the line (glyphs, glyph widths, etc.).
Returns
the current line.
Obtains the extents of the current line. ink_rect
or logical_rect
can be None
if you aren’t interested in them. Extents are in layout
coordinates (origin is the top-left corner of the entire
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 LayoutLine::extents()
.
Returns
ink_rect
rectangle to fill with ink extents, or None
logical_rect
rectangle to fill with logical extents, or None
Divides the vertical space in the Layout
being 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
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.
Returns
y0_
start of line, or None
y1_
end of line, or None
Gets the current run. When iterating by run, at the end of each
line, there’s a position with a None
run, so this function can return
None
. The None
run 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 run_readonly()
if you do not plan
to modify the contents of the run (glyphs, glyph widths, etc.).
Returns
the current run.
Gets the extents of the current run in layout coordinates (origin is the top left of the entire layout).
Returns
ink_rect
rectangle to fill with ink extents, or None
logical_rect
rectangle to fill with logical extents, or None
Gets the current run. When iterating by run, at the end of each
line, there’s a position with a None
run, so this function can return
None
. The None
run 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 run()
,
but the user is not expected
to modify the contents of the run (glyphs, glyph widths, etc.).
Returns
the current run, that should not be modified.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the type identifier of Self
.
Auto Trait Implementations
impl RefUnwindSafe for LayoutIter
impl !Send for LayoutIter
impl !Sync for LayoutIter
impl Unpin for LayoutIter
impl UnwindSafe for LayoutIter
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,