Skip to main content

GlyphRun

Struct GlyphRun 

Source
pub struct GlyphRun<'a> {
    pub typeface: &'a Typeface,
    pub size: f32,
    /* private fields */
}
Expand description

The glyphs of one run of a line, ready to draw.

Fields§

§typeface: &'a Typeface

The typeface the glyphs come from.

§size: f32

The font size in pixels.

Implementations§

Source§

impl GlyphRun<'_>

Source

pub fn positions(&self) -> impl Iterator<Item = PositionedGlyph> + '_

Each glyph with the position of its origin in the layout, left to right.

Source

pub fn text(&self) -> Range<usize> ⓘ

The text the run draws.

Source

pub fn baseline(&self) -> f32

Where the run’s baseline sits, from the layout’s top edge.

Source

pub fn edges(&self) -> (f32, f32)

The run’s left and right edges, from the layout’s left edge.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for GlyphRun<'a>

§

impl<'a> !UnwindSafe for GlyphRun<'a>

§

impl<'a> Forget for GlyphRun<'a>

§

impl<'a> Freeze for GlyphRun<'a>

§

impl<'a> Move for GlyphRun<'a>

§

impl<'a> Send for GlyphRun<'a>

§

impl<'a> Sync for GlyphRun<'a>

§

impl<'a> Unpin for GlyphRun<'a>

§

impl<'a> UnsafeUnpin for GlyphRun<'a>

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<T> ErasedDestructor for T
where T: 'static,

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, 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.