pub struct LineGeometry {
pub index: usize,
pub byte_range: Range<usize>,
pub char_range: Range<usize>,
pub rect: [f32; 4],
pub baseline: f32,
pub caret_x: f32,
pub segments: Vec<LineSegment>,
pub end: LineEnd,
pub truncation: Option<LineTruncation>,
}Expand description
One laid-out visual line.
Fields§
§index: usizeZero-based index of this line within the layout.
byte_range: Range<usize>Byte range of the line in the source text, including any trailing
hard break (see LineEnd).
char_range: Range<usize>Character range of the line, in the same text.
rect: [f32; 4]Bounding box [x, y, width, height] in layout-local coordinates.
y is the top of the line box, height its full line height.
baseline: f32Baseline y in layout-local coordinates.
caret_x: f32Where a caret sits on a line with no glyphs of its own — the x the first typed character would take, honouring indent, alignment and base direction.
segments: Vec<LineSegment>Direction-uniform stretches in logical order.
Empty means unmeasurable, never partial: a consumer that finds no segments must fall back to degenerate geometry for the whole line rather than for part of it.
end: LineEndHow the line ends.
truncation: Option<LineTruncation>Set when the line was cut short and an ellipsis drawn.
Trait Implementations§
Source§impl Clone for LineGeometry
impl Clone for LineGeometry
Source§fn clone(&self) -> LineGeometry
fn clone(&self) -> LineGeometry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more