Struct ab_glyph::FontArc [−][src]
pub struct FontArc(_);
Expand description
Font
implementor that wraps another concrete Font + 'static
type storing in an Arc
.
Provides convenient type erasure & cheap clones (particularly for FontVec
).
Example
use ab_glyph::{Font, FontArc};
let font = FontArc::try_from_slice(include_bytes!("../../dev/fonts/Exo2-Light.otf"))?;
assert_eq!(font.glyph_id('s'), ab_glyph::GlyphId(56));
Implementations
Trait Implementations
Get the size of the font unit Read more
Unscaled glyph ascent. Read more
Unscaled glyph descent. Read more
Unscaled line gap. Read more
Unscaled horizontal advance for a given glyph id. Read more
Unscaled horizontal side bearing for a given glyph id. Read more
Unscaled vertical advance for a given glyph id. Read more
Unscaled vertical side bearing for a given glyph id. Read more
Returns additional unscaled kerning to apply for a particular pair of glyph ids. Read more
Compute unscaled glyph outline curves & bounding box.
The number of glyphs present in this font. Glyph identifiers for this
font will always be in the range 0..self.glyph_count()
Read more
fn codepoint_ids(&self) -> CodepointIdIter<'_>ⓘNotable traits for CodepointIdIter<'a>impl<'a> Iterator for CodepointIdIter<'a> type Item = (GlyphId, char);
fn codepoint_ids(&self) -> CodepointIdIter<'_>ⓘNotable traits for CodepointIdIter<'a>impl<'a> Iterator for CodepointIdIter<'a> type Item = (GlyphId, char);
impl<'a> Iterator for CodepointIdIter<'a> type Item = (GlyphId, char);
Returns an iterator of all distinct (GlyphId, char)
pairs. Not ordered. Read more
Returns a pre-rendered image of the glyph. Read more
Unscaled height ascent - descent
. Read more
Returns the layout bounds of this glyph. These are different to the outline px_bounds()
. Read more
Compute glyph outline ready for drawing.
Construct a PxScaleFontRef
by associating with the
given pixel scale
. Read more
Move into a PxScaleFont
associated with the
given pixel scale
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for FontArc
impl !UnwindSafe for FontArc
Blanket Implementations
Mutably borrows from an owned value. Read more