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§
source§impl GlyphId
impl GlyphId
sourcepub fn with_scale_and_position<S: Into<PxScale>, P: Into<Point>>(
self,
scale: S,
position: P,
) -> Glyph
pub fn with_scale_and_position<S: Into<PxScale>, P: Into<Point>>( self, scale: S, position: P, ) -> Glyph
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));
sourcepub fn with_scale<S: Into<PxScale>>(self, scale: S) -> Glyph
pub fn with_scale<S: Into<PxScale>>(self, scale: S) -> Glyph
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§
source§impl Ord for GlyphId
impl Ord for GlyphId
source§impl PartialOrd for GlyphId
impl PartialOrd for GlyphId
impl Copy for GlyphId
impl Eq for GlyphId
impl StructuralPartialEq for GlyphId
Auto Trait Implementations§
impl Freeze for GlyphId
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 Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)