pub struct GlyphSourceOrder(u64);Expand description
An ordered list of glyph sources, most preferred first.
Holds every source, four bits each, in eight bytes. It can be used as a constant and passed by value. A source listed more than once keeps only its first position.
How an order is used depends on the consumer:
- Outlines use one base source per font. This is the first of
Glyf,Cff2,CffandType1that the font contains. IfVarccomes before the base source, it applies to the glyphs it covers, and its components are drawn from the base source. - Bitmaps use the first of
Sbix,CbdtandEbdtthat the font contains. - Glyph extents try each source in the font, in order, until one provides extents for the glyph.
Tuple Fields§
§0: u64Implementations§
Source§impl GlyphSourceOrder
impl GlyphSourceOrder
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The default order for measuring glyphs: sbix, CBDT, COLR,
VARC, glyf, CFF2, CFF, then Type 1 charstrings.
Color bitmaps come first, then color glyphs, then outlines with
VARC before its base source. EBDT is not included, so monochrome
and grayscale bitmaps are used only when a caller asks for them.
Sourcepub const ALL: Self
pub const ALL: Self
Every source: sbix, CBDT, EBDT, COLR, VARC, glyf, CFF2,
CFF, then Type 1 charstrings.
The order of DEFAULT, with EBDT after the color
bitmaps.
Sourcepub const BASE_OUTLINES: Self
pub const BASE_OUTLINES: Self
The outline sources without VARC: glyf, CFF2, CFF, then Type
1 charstrings.
Every glyph is drawn from the base source.
Sourcepub const COLOR_BITMAPS: Self
pub const COLOR_BITMAPS: Self
The color bitmap sources: sbix, then CBDT.
Sourcepub const MONO_BITMAPS: Self
pub const MONO_BITMAPS: Self
The monochrome and grayscale bitmap source: EBDT.
Sourcepub const fn new(sources: &[GlyphSource]) -> Self
pub const fn new(sources: &[GlyphSource]) -> Self
Creates an order from sources.
A source listed more than once keeps only its first position.
Sourcepub const fn contains(self, source: GlyphSource) -> bool
pub const fn contains(self, source: GlyphSource) -> bool
Returns true if the order contains source.
Sourcepub fn iter(self) -> impl Iterator<Item = GlyphSource>
pub fn iter(self) -> impl Iterator<Item = GlyphSource>
Returns an iterator over the sources, most preferred first.
Trait Implementations§
Source§impl Clone for GlyphSourceOrder
impl Clone for GlyphSourceOrder
Source§fn clone(&self) -> GlyphSourceOrder
fn clone(&self) -> GlyphSourceOrder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more