pub struct LayoutLine {
pub runs: Vec<PositionedRun>,
pub y: f32,
pub ascent: f32,
pub descent: f32,
pub leading: f32,
pub line_height: f32,
pub width: f32,
pub char_range: Range<usize>,
}Fields§
§runs: Vec<PositionedRun>§y: f32Baseline y relative to block top (set by block layout).
ascent: f32§descent: f32§leading: f32§line_height: f32Total line height: ascent + descent + leading.
width: f32Actual content width (sum of run advances).
char_range: Range<usize>Character range in the block’s text.
Implementations§
Source§impl LayoutLine
impl LayoutLine
Sourcepub fn x_for_offset(&self, offset: usize) -> f32
pub fn x_for_offset(&self, offset: usize) -> f32
Find the x coordinate for a char offset within this line.
Walks runs and glyphs, returning the x position of the first glyph
whose cluster >= offset. Falls back to the end of the line.
Auto Trait Implementations§
impl Freeze for LayoutLine
impl RefUnwindSafe for LayoutLine
impl Send for LayoutLine
impl Sync for LayoutLine
impl Unpin for LayoutLine
impl UnsafeUnpin for LayoutLine
impl UnwindSafe for LayoutLine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more