pub struct GlyphId(pub u16);
Expand description
Glyph id.
Example
use ab_glyph::{Font, FontRef, 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) -> Glyphwhere
S: Into<PxScale>,
P: Into<Point>,
pub fn with_scale_and_position<S, P>(self, scale: S, position: P) -> Glyphwhere 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) -> Glyphwhere
S: Into<PxScale>,
pub fn with_scale<S>(self, scale: S) -> Glyphwhere 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 Ord for GlyphId
impl Ord for GlyphId
§impl PartialOrd<GlyphId> for GlyphId
impl PartialOrd<GlyphId> for GlyphId
§fn partial_cmp(&self, other: &GlyphId) -> Option<Ordering>
fn partial_cmp(&self, other: &GlyphId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more