Struct wgpu_glyph::ab_glyph::GlyphId [−]
pub struct GlyphId(pub u16);
Expand description
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');
Tuple Fields
0: u16
Implementations
impl GlyphId
impl GlyphId
pub fn with_scale_and_position<S, P>(self, scale: S, position: P) -> Glyph where
S: Into<PxScale>,
P: Into<Point>,
pub fn with_scale_and_position<S, P>(self, scale: S, position: P) -> Glyph where
S: Into<PxScale>,
P: Into<Point>,
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>(self, scale: S) -> Glyph where
S: Into<PxScale>,
pub fn with_scale<S>(self, scale: S) -> Glyph where
S: Into<PxScale>,
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 PartialOrd<GlyphId> for GlyphId
impl PartialOrd<GlyphId> for GlyphId
pub fn partial_cmp(&self, other: &GlyphId) -> Option<Ordering>
pub fn partial_cmp(&self, other: &GlyphId) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl StructuralEq for GlyphId
impl StructuralPartialEq for GlyphId
Auto Trait Implementations
impl RefUnwindSafe for GlyphId
impl UnwindSafe for GlyphId
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> CallHasher for T where
T: Hash,
impl<T> CallHasher for T where
T: Hash,
Compare self to key
and return true
if they are equal.