Struct ab_glyph::FontRef [−][src]
pub struct FontRef<'font>(_);Expand description
Implementations
Creates an FontRef from a byte-slice.
For font collections see
FontRef::try_from_slice_and_index.
Example
let font = FontRef::try_from_slice(include_bytes!("../../dev/fonts/Exo2-Light.otf"))?;Creates an FontRef from byte-slice.
You can set index for font collections. For simple fonts use 0 or
FontRef::try_from_slice.
Example
let font =
FontRef::try_from_slice_and_index(include_bytes!("../../dev/fonts/Exo2-Light.otf"), 0)?;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<'a>(&'a self) -> CodepointIdIter<'a>ⓘNotable traits for CodepointIdIter<'a>impl<'a> Iterator for CodepointIdIter<'a> type Item = (GlyphId, char);
fn codepoint_ids<'a>(&'a self) -> CodepointIdIter<'a>ⓘ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<'font> RefUnwindSafe for FontRef<'font>
impl<'font> UnwindSafe for FontRef<'font>
Blanket Implementations
Mutably borrows from an owned value. Read more
