pub struct TextRun2d { /* private fields */ }Expand description
Retained, shaped single-line text and its baseline metrics.
Drawing an unchanged run needs no shaping, rasterization or geometry upload.
Whitespace contributes to Self::advance but emits no glyph quad. Drawable
bounds include filtering support and are not typographic advance bounds.
Implementations§
Source§impl TextRun2d
impl TextRun2d
Sourcepub const fn glyph_run(&self) -> &GlyphRun2d
pub const fn glyph_run(&self) -> &GlyphRun2d
Returns the retained glyph instances for a composed glyph draw.
Sourcepub const fn advance(&self) -> f32
pub const fn advance(&self) -> f32
Returns horizontal advance, including spaces, in logical pixels.
Sourcepub const fn ascent(&self) -> f32
pub const fn ascent(&self) -> f32
Returns the font ascender above the baseline in logical pixels.
Sourcepub const fn descent(&self) -> f32
pub const fn descent(&self) -> f32
Returns the signed font descender below the baseline in logical pixels.
Sourcepub const fn line_height(&self) -> f32
pub const fn line_height(&self) -> f32
Returns the font-recommended baseline spacing in logical pixels.
Sourcepub fn recovery_memory_bytes(&self) -> usize
pub fn recovery_memory_bytes(&self) -> usize
Returns retained UTF-8 and glyph-layout allocation bytes, excluding allocator overhead.
Auto Trait Implementations§
impl !Freeze for TextRun2d
impl !RefUnwindSafe for TextRun2d
impl !UnwindSafe for TextRun2d
impl Send for TextRun2d
impl Sync for TextRun2d
impl Unpin for TextRun2d
impl UnsafeUnpin for TextRun2d
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