pub struct TextLayoutData {
pub width: f32,
pub height: f32,
pub line_height: f32,
pub glyph_x_positions: Vec<f32>,
pub char_to_byte: Vec<usize>,
pub lines: Vec<LineLayout>,
pub glyph_layouts: Vec<GlyphLayout>,
}Expand description
Cached text layout result with pre-computed glyph positions.
Compute once during measure(), reuse for:
- Cursor X position rendering
- Selection highlight geometry
- Click-to-position cursor
Fields§
§width: f32Total width of laid out text
height: f32Total height of laid out text
line_height: f32Height of a single line
glyph_x_positions: Vec<f32>X position at each character boundary (including end)
char_to_byte: Vec<usize>Byte offset for each character index
lines: Vec<LineLayout>Line layout information
glyph_layouts: Vec<GlyphLayout>Visual glyph boxes in shaped order.
Trait Implementations§
Source§impl Clone for TextLayoutData
impl Clone for TextLayoutData
Source§fn clone(&self) -> TextLayoutData
fn clone(&self) -> TextLayoutData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextLayoutData
impl RefUnwindSafe for TextLayoutData
impl Send for TextLayoutData
impl Sync for TextLayoutData
impl Unpin for TextLayoutData
impl UnsafeUnpin for TextLayoutData
impl UnwindSafe for TextLayoutData
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