pub struct LookupVariations<'a> {
data: FontData<'a>,
records: &'a [LookupVariationRecord],
}Expand description
The lookup variations of a FeatureVariations table, which change the
lookups of a feature depending on the location in design space.
Fields§
§data: FontData<'a>§records: &'a [LookupVariationRecord]Implementations§
Source§impl<'a> LookupVariations<'a>
impl<'a> LookupVariations<'a>
Sourcepub fn apply<E>(
&self,
feature_index: u16,
coords: &[F2Dot14],
delta: impl FnMut(u32) -> Result<f64, E>,
lookups: &mut Vec<u16>,
) -> bool
pub fn apply<E>( &self, feature_index: u16, coords: &[F2Dot14], delta: impl FnMut(u32) -> Result<f64, E>, lookups: &mut Vec<u16>, ) -> bool
Applies the lookup variations of a feature at a location.
lookups holds the feature’s lookup indices. They are replaced,
unless the variations only add to them, by the lookups of each
condition record whose condition holds at coords. Format 2
conditions resolve their deltas through delta; see
Condition::evaluate.
The added lookups may be unsorted and repeat ones already present. All conditions of the feature share one evaluation budget.
Returns false, leaving lookups unchanged, if the feature has no
lookup variations.
Sourcepub fn add_all(&self, feature_index: u16, lookups: &mut Vec<u16>) -> bool
pub fn add_all(&self, feature_index: u16, lookups: &mut Vec<u16>) -> bool
Adds the lookups of every condition record of a feature, as if each condition held: the lookups the feature can use anywhere in design space.
Returns false if the feature has no lookup variations.
Sourcefn feature_lookups(&self, feature_index: u16) -> Option<FeatureLookups<'a>>
fn feature_lookups(&self, feature_index: u16) -> Option<FeatureLookups<'a>>
The conditional lookups of a feature, if it has readable ones.
Trait Implementations§
Source§impl<'a> Clone for LookupVariations<'a>
impl<'a> Clone for LookupVariations<'a>
Source§fn clone(&self) -> LookupVariations<'a>
fn clone(&self) -> LookupVariations<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more