pub struct Outlines {
face: Face<'static>,
metrics: Metrics,
traced: RefCell<HashMap<GlyphId, Arc<[PathCommand]>>>,
}Expand description
A face’s outlines, traced on demand and kept: a label redrawn every frame traces its glyphs once.
Fields§
§face: Face<'static>§metrics: Metrics§traced: RefCell<HashMap<GlyphId, Arc<[PathCommand]>>>Implementations§
Source§impl Outlines
impl Outlines
Sourcepub fn new(typeface: FontChoice) -> Self
pub fn new(typeface: FontChoice) -> Self
§Panics
If the typeface’s embedded bytes are not a font this can read.
Sourcepub fn metrics(&self) -> Metrics
pub fn metrics(&self) -> Metrics
The metrics the Shaper over the same typeface lays
rows out by, so a consumer scales these outlines the way that layout
was measured.
Sourcepub fn glyph_index(&self, chr: char) -> Option<GlyphId>
pub fn glyph_index(&self, chr: char) -> Option<GlyphId>
The glyph a face’s character map files chr under — the identity a
layout that carries none falls back to.
Sourcepub fn outline(&self, id: GlyphId) -> Arc<[PathCommand]>
pub fn outline(&self, id: GlyphId) -> Arc<[PathCommand]>
id’s contours, empty where the glyph draws nothing (a space, an
unmapped character).
Auto Trait Implementations§
impl !Freeze for Outlines
impl !RefUnwindSafe for Outlines
impl Send for Outlines
impl !Sync for Outlines
impl Unpin for Outlines
impl UnsafeUnpin for Outlines
impl UnwindSafe for Outlines
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more