pub struct FeatureVariations<'a> {
data: TableDataRef<'a, FeatureVariationsFixedHeader>,
}Expand description
FeatureVariations Table Version 1.1 is defined in ISO/IEC 14496-22:2026, 6.2.11.
Fields§
§data: TableDataRef<'a, FeatureVariationsFixedHeader>Implementations§
Source§impl FeatureVariations<'_>
impl FeatureVariations<'_>
Source§impl<'a> FeatureVariations<'a>
impl<'a> FeatureVariations<'a>
Sourcepub fn lookup_variation_records(&self) -> Option<&'a [LookupVariationRecord]>
pub fn lookup_variation_records(&self) -> Option<&'a [LookupVariationRecord]>
Lookup variations, sorted by feature index; absent in version 1.0.
Sourcepub fn lookup_variations(&self) -> Option<LookupVariations<'a>>
pub fn lookup_variations(&self) -> Option<LookupVariations<'a>>
Returns the table’s lookup variations, or None if it has none.
Only version 1.1 and later tables carry lookup variations, so for other tables this is a version check. Records that are not strictly sorted by feature index are ignored as a whole.
Source§impl<'a> FeatureVariations<'a>
impl<'a> FeatureVariations<'a>
pub const MIN_SIZE: usize
Sourcepub fn resolve_offset<O: Offset, R: FontRead<'a, Args = ()>>(
&self,
offset: O,
) -> Result<R, ReadError>
pub fn resolve_offset<O: Offset, R: FontRead<'a, Args = ()>>( &self, offset: O, ) -> Result<R, ReadError>
Resolve the provided offset from the start of this table.
Sourcepub fn offset_data(&self) -> FontData<'a>
pub fn offset_data(&self) -> FontData<'a>
Return a reference to this table’s raw data.
We use this in the compile crate to resolve offsets.
Sourcepub fn shape(&self) -> &Self
👎Deprecated: just use the base type directly
pub fn shape(&self) -> &Self
just use the base type directly
Return a reference to the table’s ‘Shape’ struct.
This is a low level implementation detail, but it can be useful in some cases where you want to know things about a table’s layout, such as the byte offsets of specific fields.
pub fn version(&self) -> MajorMinor
Sourcepub fn feature_variation_record_count(&self) -> u32
pub fn feature_variation_record_count(&self) -> u32
Number of feature variation records.
Sourcepub fn feature_variation_records(&self) -> &'a [FeatureVariationRecord]
pub fn feature_variation_records(&self) -> &'a [FeatureVariationRecord]
Array of feature variation records.
Sourcepub fn lookup_variation_record_count(&self) -> Option<u32>
pub fn lookup_variation_record_count(&self) -> Option<u32>
Number of lookup variation records.
pub fn version_byte_range(&self) -> Range<usize> ⓘ
pub fn feature_variation_record_count_byte_range(&self) -> Range<usize> ⓘ
pub fn feature_variation_records_byte_range(&self) -> Range<usize> ⓘ
pub fn lookup_variation_record_count_byte_range(&self) -> Range<usize> ⓘ
pub fn lookup_variation_records_byte_range(&self) -> Range<usize> ⓘ
Source§impl FeatureVariations<'_>
impl FeatureVariations<'_>
Sourcepub fn index_for_coords(&self, coords: &[F2Dot14]) -> Option<u32>
pub fn index_for_coords(&self, coords: &[F2Dot14]) -> Option<u32>
Returns the index of the first feature variation record that matches
the given coordinates. Format-2 conditions use their default values;
use Self::index_for_coords_with_delta to include variation deltas.
Sourcepub fn index_for_coords_with_delta<E>(
&self,
coords: &[F2Dot14],
delta: impl FnMut(u32) -> Result<f64, E>,
) -> Option<u32>
pub fn index_for_coords_with_delta<E>( &self, coords: &[F2Dot14], delta: impl FnMut(u32) -> Result<f64, E>, ) -> Option<u32>
Returns the first matching record, resolving format-2 variation deltas
with the caller’s variation store. Records with invalid conditions are
skipped. See Condition::evaluate for evaluation behavior.
Trait Implementations§
Source§impl<'a> Clone for FeatureVariations<'a>
impl<'a> Clone for FeatureVariations<'a>
Source§fn clone(&self) -> FeatureVariations<'a>
fn clone(&self) -> FeatureVariations<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more