pub(crate) enum UnscaledStyleMetricsSet {
Precomputed(Vec<UnscaledStyleMetrics>),
Lazy(Arc<RwLock<Vec<Option<UnscaledStyleMetrics>>>>),
}
Expand description
The set of unscaled style metrics for a single font.
For a variable font, this is dependent on the location in variation space.
Variants§
Precomputed(Vec<UnscaledStyleMetrics>)
Lazy(Arc<RwLock<Vec<Option<UnscaledStyleMetrics>>>>)
Implementations§
Source§impl UnscaledStyleMetricsSet
impl UnscaledStyleMetricsSet
Sourcepub fn precomputed(
font: &FontRef<'_>,
coords: &[F2Dot14],
shaper_mode: ShaperMode,
style_map: &GlyphStyleMap,
) -> Self
pub fn precomputed( font: &FontRef<'_>, coords: &[F2Dot14], shaper_mode: ShaperMode, style_map: &GlyphStyleMap, ) -> Self
Creates a precomputed style metrics set containing all metrics required by the glyph map.
Sourcepub fn lazy(style_map: &GlyphStyleMap) -> Self
pub fn lazy(style_map: &GlyphStyleMap) -> Self
Creates an unscaled style metrics set where each entry will be initialized as needed.
Sourcepub fn get(
&self,
font: &FontRef<'_>,
coords: &[F2Dot14],
shaper_mode: ShaperMode,
style_map: &GlyphStyleMap,
glyph_id: GlyphId,
) -> Option<UnscaledStyleMetrics>
pub fn get( &self, font: &FontRef<'_>, coords: &[F2Dot14], shaper_mode: ShaperMode, style_map: &GlyphStyleMap, glyph_id: GlyphId, ) -> Option<UnscaledStyleMetrics>
Returns the unscaled style metrics for the given style map and glyph identifier.
Trait Implementations§
Source§impl Clone for UnscaledStyleMetricsSet
impl Clone for UnscaledStyleMetricsSet
Source§fn clone(&self) -> UnscaledStyleMetricsSet
fn clone(&self) -> UnscaledStyleMetricsSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for UnscaledStyleMetricsSet
impl RefUnwindSafe for UnscaledStyleMetricsSet
impl Send for UnscaledStyleMetricsSet
impl Sync for UnscaledStyleMetricsSet
impl Unpin for UnscaledStyleMetricsSet
impl UnwindSafe for UnscaledStyleMetricsSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more