Struct swash::GlyphMetrics[][src]

pub struct GlyphMetrics<'a> { /* fields omitted */ }

Glyph advances, side bearings and vertical origins.

Implementations

impl<'a> GlyphMetrics<'a>[src]

pub fn units_per_em(&self) -> u16[src]

Returns the number of font design units per em unit.

pub fn glyph_count(&self) -> u16[src]

Returns the number of glyphs in the font.

pub fn has_vertical_metrics(&self) -> bool[src]

Returns true if the font provides canonical vertical glyph metrics.

pub fn has_variations(&self) -> bool[src]

Returns true if variations are supported.

pub fn scale(&self, ppem: f32) -> Self[src]

Creates a new set of metrics scaled for the specified pixels per em unit.

pub fn linear_scale(&self, scale: f32) -> Self[src]

Creates a new set of metrics scaled by the specified factor.

pub fn advance_width(&self, glyph_id: GlyphId) -> f32[src]

Returns the horizontal advance for the specified glyph.

pub fn lsb(&self, glyph_id: GlyphId) -> f32[src]

Returns the left side bearing for the specified glyph.

pub fn advance_height(&self, glyph_id: GlyphId) -> f32[src]

Returns the vertical advance for the specified glyph.

pub fn tsb(&self, glyph_id: GlyphId) -> f32[src]

Returns the top side bearing for the specified glyph.

pub fn vertical_origin(&self, glyph_id: GlyphId) -> f32[src]

Returns the vertical origin for the specified glyph id.

Trait Implementations

impl<'a> Clone for GlyphMetrics<'a>[src]

impl<'a> Copy for GlyphMetrics<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for GlyphMetrics<'a>

impl<'a> Send for GlyphMetrics<'a>

impl<'a> Sync for GlyphMetrics<'a>

impl<'a> Unpin for GlyphMetrics<'a>

impl<'a> UnwindSafe for GlyphMetrics<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.