[][src]Struct ab_glyph::GlyphId

pub struct GlyphId(pub u16);

Glyph id.

Example

use ab_glyph::{FontRef, Font, GlyphId};
let font = FontRef::try_from_slice(include_bytes!("../../dev/fonts/Exo2-Light.otf"))?;

let q_id: GlyphId = font.glyph_id('q');

Implementations

impl GlyphId[src]

pub fn with_scale_and_position<S: Into<PxScale>, P: Into<Point>>(
    self,
    scale: S,
    position: P
) -> Glyph
[src]

Construct a Glyph with given scale & position.

Example

let glyph = font.glyph_id('z').with_scale_and_position(24.0, point(100.0, 0.0));

pub fn with_scale<S: Into<PxScale>>(self, scale: S) -> Glyph[src]

Construct a Glyph with given scale and position point(0.0, 0.0).

Example

let glyph = font.glyph_id('w').with_scale(48.0);

Trait Implementations

impl Clone for GlyphId[src]

impl Copy for GlyphId[src]

impl Debug for GlyphId[src]

impl Default for GlyphId[src]

impl Eq for GlyphId[src]

impl From<GlyphId> for GlyphId[src]

impl Hash for GlyphId[src]

impl Ord for GlyphId[src]

impl PartialEq<GlyphId> for GlyphId[src]

impl PartialOrd<GlyphId> for GlyphId[src]

impl StructuralEq for GlyphId[src]

impl StructuralPartialEq for GlyphId[src]

Auto Trait Implementations

impl RefUnwindSafe for GlyphId

impl Send for GlyphId

impl Sync for GlyphId

impl Unpin for GlyphId

impl UnwindSafe for GlyphId

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.