pub struct OutlineGlyphs<'a> {
font: &'a Font,
base: Base<'a>,
varc: Option<&'a Outlines<'a>>,
}Expand description
Provides access to the glyph outlines in a font.
The sources used for drawing are selected when this is created. It is cheap to create and copy because it only borrows tables that the font has already parsed.
Fields§
§font: &'a Font§base: Base<'a>§varc: Option<&'a Outlines<'a>>Implementations§
Source§impl<'a> OutlineGlyphs<'a>
impl<'a> OutlineGlyphs<'a>
Sourcepub fn source(&self) -> Option<OutlineSource>
pub fn source(&self) -> Option<OutlineSource>
Returns the table that provides the outlines.
This is OutlineSource::Varc if VARC composites are drawn. The
composites cover only some glyphs, and the rest come from the
underlying_source. Returns None if the
font has no outlines from the requested sources.
Sourcepub fn underlying_source(&self) -> Option<OutlineSource>
pub fn underlying_source(&self) -> Option<OutlineSource>
Returns the table that draws the glyphs VARC does not cover and the
components of those it does.
This is the same as source unless VARC
composites are drawn, and is never OutlineSource::Varc. Returns
None if the font has no outlines from the requested sources.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the font has no outlines from the requested sources.
Sourcepub fn len(&self) -> u32
pub fn len(&self) -> u32
Returns the number of glyphs in the font.
Returns zero if the font has no outlines from the requested sources.
Sourcepub fn get(&self, glyph: GlyphId) -> Option<OutlineGlyph<'a>>
pub fn get(&self, glyph: GlyphId) -> Option<OutlineGlyph<'a>>
Returns the outline for glyph, or None if it has no outline or
its data in the base source cannot be read.
If VARC is enabled and the table covers the glyph, this returns a
VARC composite. Otherwise, the outline comes from the base source.
A composite that is malformed or nests past the recursion or edge
limits returns an error when it is drawn.
Sourcepub fn iter(&self) -> impl Iterator<Item = (GlyphId, OutlineGlyph<'a>)> + 'a
pub fn iter(&self) -> impl Iterator<Item = (GlyphId, OutlineGlyph<'a>)> + 'a
Returns an iterator over every glyph that has an outline, in glyph identifier order.
Trait Implementations§
Source§impl<'a> Clone for OutlineGlyphs<'a>
impl<'a> Clone for OutlineGlyphs<'a>
Source§fn clone(&self) -> OutlineGlyphs<'a>
fn clone(&self) -> OutlineGlyphs<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for OutlineGlyphs<'a>
Source§impl<'yoke> Yokeable<'yoke> for OutlineGlyphs<'static>
impl<'yoke> Yokeable<'yoke> for OutlineGlyphs<'static>
Source§type Output = OutlineGlyphs<'yoke>
type Output = OutlineGlyphs<'yoke>
Self with the 'static replaced with 'a, i.e. Self<'a>Source§fn transform_owned(self) -> <OutlineGlyphs<'static> as Yokeable<'yoke>>::Output
fn transform_owned(self) -> <OutlineGlyphs<'static> as Yokeable<'yoke>>::Output
Source§unsafe fn make(
from: <OutlineGlyphs<'static> as Yokeable<'yoke>>::Output,
) -> OutlineGlyphs<'static>
unsafe fn make( from: <OutlineGlyphs<'static> as Yokeable<'yoke>>::Output, ) -> OutlineGlyphs<'static>
Self<'a>’s lifetime. Read moreSource§fn transform_mut<F>(&'yoke mut self, f: F)where
F: 'static + for<'_yoke> FnOnce(&'_yoke mut <OutlineGlyphs<'static> as Yokeable<'yoke>>::Output),
fn transform_mut<F>(&'yoke mut self, f: F)where
F: 'static + for<'_yoke> FnOnce(&'_yoke mut <OutlineGlyphs<'static> as Yokeable<'yoke>>::Output),
self between &'a mut Self<'static> and &'a mut Self<'a>,
and pass it to f. Read more