#[non_exhaustive]pub struct LineSegment {
pub byte_range: Range<usize>,
pub char_range: Range<usize>,
pub direction: GeometryDirection,
pub rect: [f32; 4],
pub characters: Vec<CharacterGeometry>,
}Expand description
One direction-uniform stretch of a laid-out line.
A pure LTR or pure RTL line has exactly one segment; a bidirectional line has one per direction change, in logical order.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.byte_range: Range<usize>Byte range of this segment in the source text (or, on the markup
paths, in LayoutGeometry::rendered_text).
char_range: Range<usize>Character range of this segment, in the same text.
direction: GeometryDirectionReading direction of every character in this segment.
rect: [f32; 4]Bounding box [x, y, width, height] in layout-local coordinates.
characters: Vec<CharacterGeometry>One entry per character of char_range, in logical order.
position is measured from the segment’s leading edge — its
left edge when direction is
GeometryDirection::LeftToRight, its right edge when it is
GeometryDirection::RightToLeft — so positions are
non-decreasing and widths are never negative in both cases.
A character with no advance of its own (a combining mark, the
interior of a ligature) reports its cluster’s leading position and
a width of 0.0.