pub struct ItemVariationStore<'a> {
data: TableDataRef<'a, ItemVariationStoreFixedHeader>,
}Expand description
The ItemVariationStore table
Fields§
§data: TableDataRef<'a, ItemVariationStoreFixedHeader>Implementations§
Source§impl<'a> ItemVariationStore<'a>
impl<'a> ItemVariationStore<'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.
Sourcepub fn variation_region_list_offset(&self) -> Offset32
pub fn variation_region_list_offset(&self) -> Offset32
Offset in bytes from the start of the item variation store to the variation region list.
Sourcepub fn variation_region_list(
&self,
) -> Result<VariationRegionList<'a>, ReadError>
pub fn variation_region_list( &self, ) -> Result<VariationRegionList<'a>, ReadError>
Attempt to resolve variation_region_list_offset.
Sourcepub fn item_variation_data_count(&self) -> u16
pub fn item_variation_data_count(&self) -> u16
The number of item variation data subtables.
Sourcepub fn item_variation_data_offsets(&self) -> &'a [BigEndian<Nullable<Offset32>>]
pub fn item_variation_data_offsets(&self) -> &'a [BigEndian<Nullable<Offset32>>]
Offsets in bytes from the start of the item variation store to each item variation data subtable.
Sourcepub fn item_variation_data(
&self,
) -> ArrayOfNullableOffsets<'a, ItemVariationData<'a>, Offset32>
pub fn item_variation_data( &self, ) -> ArrayOfNullableOffsets<'a, ItemVariationData<'a>, Offset32>
A dynamically resolving wrapper for item_variation_data_offsets.
pub fn format_byte_range(&self) -> Range<usize> ⓘ
pub fn variation_region_list_offset_byte_range(&self) -> Range<usize> ⓘ
pub fn item_variation_data_count_byte_range(&self) -> Range<usize> ⓘ
pub fn item_variation_data_offsets_byte_range(&self) -> Range<usize> ⓘ
Source§impl ItemVariationStore<'_>
impl ItemVariationStore<'_>
Sourcepub fn compute_delta(
&self,
index: DeltaSetIndex,
coords: &[F2Dot14],
) -> Option<F48Dot16>
pub fn compute_delta( &self, index: DeltaSetIndex, coords: &[F2Dot14], ) -> Option<F48Dot16>
Computes the delta value for the specified index and set of normalized variation coordinates.
Each region’s scalar is computed in 16.16 and multiplied by its raw
delta, and the products are summed exactly – 48.16 holds the largest
possible sum with room to spare. Use F48Dot16::to_i32 for the
classic integer delta, or apply the value unrounded to targets that
take fractional deltas.
Sourcepub fn compute_delta_with_scalars(
&self,
index: DeltaSetIndex,
coords: &[F2Dot14],
scalars: &[Fixed],
) -> Option<F48Dot16>
pub fn compute_delta_with_scalars( &self, index: DeltaSetIndex, coords: &[F2Dot14], scalars: &[Fixed], ) -> Option<F48Dot16>
Computes the delta for index at coords, reusing scalars.
scalars holds one entry per variation region, from
compute_scalars. It may be empty or cover
only some of them; the rest are computed here.
Sourcepub fn compute_scalars(&self, coords: &[F2Dot14], out: &mut [Fixed]) -> usize
pub fn compute_scalars(&self, coords: &[F2Dot14], out: &mut [Fixed]) -> usize
Computes the scalar for each variation region at coords, in store
order, and returns how many were written.
A region that does not apply at coords is written as zero, which is
the value it contributes.
out may be shorter than the store has regions, and an unreadable
store writes nothing.
compute_delta_with_scalars
computes whatever is missing.
Pass back only the entries this wrote. Regions are dense, so the length of the slice is what identifies them.
Trait Implementations§
Source§impl<'a> Clone for ItemVariationStore<'a>
impl<'a> Clone for ItemVariationStore<'a>
Source§fn clone(&self) -> ItemVariationStore<'a>
fn clone(&self) -> ItemVariationStore<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more