pub struct Mvar<'a> {
data: TableDataRef<'a, MvarFixedHeader>,
}Expand description
The MVAR (Metrics Variations) table
Fields§
§data: TableDataRef<'a, MvarFixedHeader>Implementations§
Source§impl<'a> Mvar<'a>
impl<'a> Mvar<'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 version(&self) -> MajorMinor
pub fn version(&self) -> MajorMinor
Major version number of the horizontal metrics variations table — set to 1. Minor version number of the horizontal metrics variations table — set to 0.
Sourcepub fn value_record_size(&self) -> u16
pub fn value_record_size(&self) -> u16
The size in bytes of each value record — must be greater than zero.
Sourcepub fn value_record_count(&self) -> u16
pub fn value_record_count(&self) -> u16
The number of value records — may be zero.
Sourcepub fn item_variation_store_offset(&self) -> Nullable<Offset16>
pub fn item_variation_store_offset(&self) -> Nullable<Offset16>
Offset in bytes from the start of this table to the item variation store table. If valueRecordCount is zero, set to zero; if valueRecordCount is greater than zero, must be greater than zero.
Sourcepub fn item_variation_store(
&self,
) -> Option<Result<ItemVariationStore<'a>, ReadError>>
pub fn item_variation_store( &self, ) -> Option<Result<ItemVariationStore<'a>, ReadError>>
Attempt to resolve item_variation_store_offset.
Sourcepub fn value_records(&self) -> &'a [ValueRecord]
pub fn value_records(&self) -> &'a [ValueRecord]
Array of value records that identify target items and the associated delta-set index for each. The valueTag records must be in binary order of their valueTag field.
pub fn version_byte_range(&self) -> Range<usize> ⓘ
pub fn _reserved_byte_range(&self) -> Range<usize> ⓘ
pub fn value_record_size_byte_range(&self) -> Range<usize> ⓘ
pub fn value_record_count_byte_range(&self) -> Range<usize> ⓘ
pub fn item_variation_store_offset_byte_range(&self) -> Range<usize> ⓘ
pub fn value_records_byte_range(&self) -> Range<usize> ⓘ
Source§impl<'a> Mvar<'a>
impl<'a> Mvar<'a>
Sourcepub fn at(&self, coords: &'a [F2Dot14]) -> Option<MvarInstance<'a>>
pub fn at(&self, coords: &'a [F2Dot14]) -> Option<MvarInstance<'a>>
Returns the table at a location.
None at the default location, where every delta is zero, and for a
font whose variation store cannot be read.