pub(super) struct SharedFont(Arc<SharedFontRepr>);Expand description
The state every instance of a font shares.
Reference counted internally: cloning it costs no more than the count, and it is thread safe.
Tuple Fields§
§0: Arc<SharedFontRepr>Implementations§
Sourcefn new(source: impl Into<Source>, index: u32) -> Option<Self>
fn new(source: impl Into<Source>, index: u32) -> Option<Self>
Creates a new font from the given source and font index.
See Font::new for how index is used.
Sourcefn multiple_master(&self) -> Option<&MultipleMaster>
fn multiple_master(&self) -> Option<&MultipleMaster>
Returns the design space of a Type 1 multiple master font.
Sourcefn type1_axes(&self) -> &[VariationAxisRecord]
fn type1_axes(&self) -> &[VariationAxisRecord]
Returns the axes of a Type 1 multiple master font, which is empty for any other font.
Sourcefn metrics(&self) -> &Metrics
fn metrics(&self) -> &Metrics
Returns the metrics describing the font as a whole, at its default location.
Sourcefn style_metrics(&self) -> &StyleMetrics
fn style_metrics(&self) -> &StyleMetrics
Returns the style measurements at the font’s default location.
Sourcepub(super) fn num_glyphs(&self) -> u32
pub(super) fn num_glyphs(&self) -> u32
Returns the number of glyphs in the font.
Fixed for the font: no location varies it.
Sourcefn units_per_em(&self) -> u16
fn units_per_em(&self) -> u16
Returns the size of the em square, in font units.
Fixed for the font: no location varies it.
Sourcepub(super) fn sfnt(&self) -> Option<&SfntCaches>
pub(super) fn sfnt(&self) -> Option<&SfntCaches>
Returns the caches of an SFNT font, or None for a font of another
kind.
Sourcefn tables_arc(&self) -> Option<&Arc<Tables>>
fn tables_arc(&self) -> Option<&Arc<Tables>>
Returns the tables behind this font, for a cache that holds them.
Sourcepub(super) fn unicode_charmap(&self) -> Option<&SfntUnicodeCharmap<'_>>
pub(super) fn unicode_charmap(&self) -> Option<&SfntUnicodeCharmap<'_>>
Returns the selected character maps, parsed once for the font.
Sourcepub(super) fn encodings(&self) -> Option<&EncodingTables<'_>>
pub(super) fn encodings(&self) -> Option<&EncodingTables<'_>>
Returns all selectable cmap subtables, parsed on first use.
pub(super) fn standalone_cff_unicode_charmap(&self) -> Option<&UnicodeCharmap>
Sourcefn h_metric_records(&self) -> &GlyphMetricRecords<'_>
fn h_metric_records(&self) -> &GlyphMetricRecords<'_>
Returns the horizontal glyph metrics, parsed once for the font.
Sourcefn v_metric_records(&self) -> &GlyphMetricRecords<'_>
fn v_metric_records(&self) -> &GlyphMetricRecords<'_>
Returns the vertical glyph metrics, parsed once for the font.
Read on demand, unlike the horizontal metrics: most text is horizontal and never asks.
Sourcefn selected_glyf_loca(&self) -> Option<&(Glyf<'_>, Loca<'_>)>
fn selected_glyf_loca(&self) -> Option<&(Glyf<'_>, Loca<'_>)>
Returns the outline tables, parsed once for the font.
Outlines and metrics in both directions read these, so they are shared rather than parsed by each.
Sourcefn selected_gvar(&self) -> Option<&SelectedGvar<'_>>
fn selected_gvar(&self) -> Option<&SelectedGvar<'_>>
Returns GVAR, or gvar without it, parsed once for the font.
Typically about half a variable font, so nothing should ask for this that another table can answer.
Sourcefn cff2(&self) -> Option<&CffFontRef<'_>>
fn cff2(&self) -> Option<&CffFontRef<'_>>
Returns the CFF2 charstring outlines, parsed once for the font.
Reading one means running it, so nothing here is parsed per glyph beyond what a charstring itself needs.
Sourcefn cff(&self) -> Option<&CffFontRef<'_>>
fn cff(&self) -> Option<&CffFontRef<'_>>
Returns the CFF charstring outlines, parsed once for the font.
fn standalone_cff(&self) -> Option<&CffFontRef<'_>>
Sourcefn cid_glyphs(&self) -> Option<&[u16]>
fn cid_glyphs(&self) -> Option<&[u16]>
Returns the glyph for each CID of a standalone CID-keyed font, built once.
As in FreeType, the table ends at the largest CID and the first glyph with a CID is kept.
fn standalone_cff_subfonts(&self) -> Option<&[Option<Subfont>]>
Sourcefn varc_outlines(&self) -> Option<&Outlines<'_>>
fn varc_outlines(&self) -> Option<&Outlines<'_>>
Returns the variable composites, read once for the font.
Sourcefn colr_tables(&self) -> Option<&ColrTables<'_>>
fn colr_tables(&self) -> Option<&ColrTables<'_>>
Returns COLR with its variation tables, read once for the font.
Trait Implementations§
Source§fn clone(&self) -> SharedFont
fn clone(&self) -> SharedFont
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more