pub struct ShapedLine { /* private fields */ }Expand description
Immutable shaped placement; rasterization and GPU ownership are separate.
Implementations§
Source§impl ShapedLine
impl ShapedLine
Sourcepub fn text(&self) -> &str
pub fn text(&self) -> &str
Original UTF-8 input; retained so prepared text needs no second shaping pass.
Sourcepub const fn font(&self) -> &FontFace
pub const fn font(&self) -> &FontFace
Immutable font shared with the original face, not a duplicate byte buffer.
Sourcepub const fn style(&self) -> &TextStyle
pub const fn style(&self) -> &TextStyle
Exact em size, DPI and requested direction used for this line.
Sourcepub fn validate_for(
&self,
font: &FontFace,
style: &TextStyle,
budget: &TextLayoutBudget,
) -> Result<(), ShapedLineError>
pub fn validate_for( &self, font: &FontFace, style: &TextStyle, budget: &TextLayoutBudget, ) -> Result<(), ShapedLineError>
Checks font identity, exact style and input/output limits without reshaping. Clones of a face share identity; separately loaded identical bytes do not. Raster limits apply later when an atlas encounters an uncached glyph.
Sourcepub fn glyphs(&self) -> &[ShapedGlyph]
pub fn glyphs(&self) -> &[ShapedGlyph]
Shaper output order. Drawing this sequence at its offsets preserves marks.
Sourcepub const fn advance(&self) -> f32
pub const fn advance(&self) -> f32
Horizontal pen advance in logical pixels, including whitespace.
Sourcepub const fn ascent(&self) -> f32
pub const fn ascent(&self) -> f32
Signed font ascender in logical pixels; normally positive above baseline.
Sourcepub const fn descent(&self) -> f32
pub const fn descent(&self) -> f32
Signed font descender in logical pixels; normally negative below baseline.
Sourcepub const fn line_height(&self) -> f32
pub const fn line_height(&self) -> f32
Font-recommended line spacing in logical pixels, including line gap.
Sourcepub fn allocation_bytes(&self) -> usize
pub fn allocation_bytes(&self) -> usize
Owned UTF-8 and glyph metadata capacity in bytes, excluding the shared font.