Skip to main content

ShapedLine

Struct ShapedLine 

Source
pub struct ShapedLine { /* private fields */ }
Expand description

Immutable shaped placement; rasterization and GPU ownership are separate.

Implementations§

Source§

impl ShapedLine

Source

pub fn text(&self) -> &str

Original UTF-8 input; retained so prepared text needs no second shaping pass.

Source

pub const fn font(&self) -> &FontFace

Immutable font shared with the original face, not a duplicate byte buffer.

Source

pub const fn style(&self) -> &TextStyle

Exact em size, DPI and requested direction used for this line.

Source

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.

Source

pub fn glyphs(&self) -> &[ShapedGlyph]

Shaper output order. Drawing this sequence at its offsets preserves marks.

Source

pub const fn advance(&self) -> f32

Horizontal pen advance in logical pixels, including whitespace.

Source

pub const fn ascent(&self) -> f32

Signed font ascender in logical pixels; normally positive above baseline.

Source

pub const fn descent(&self) -> f32

Signed font descender in logical pixels; normally negative below baseline.

Source

pub const fn line_height(&self) -> f32

Font-recommended line spacing in logical pixels, including line gap.

Source

pub fn allocation_bytes(&self) -> usize

Owned UTF-8 and glyph metadata capacity in bytes, excluding the shared font.

Trait Implementations§

Source§

impl Debug for ShapedLine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,