pub struct Vvar<'a> {
data: TableDataRef<'a, VvarFixedHeader>,
}Expand description
The VVAR (Vertical Metrics Variations) table
Fields§
§data: TableDataRef<'a, VvarFixedHeader>Implementations§
Source§impl<'a> Vvar<'a>
impl<'a> Vvar<'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 item_variation_store_offset(&self) -> Offset32
pub fn item_variation_store_offset(&self) -> Offset32
Offset in bytes from the start of this table to the item variation store table.
Sourcepub fn item_variation_store(&self) -> Result<ItemVariationStore<'a>, ReadError>
pub fn item_variation_store(&self) -> Result<ItemVariationStore<'a>, ReadError>
Attempt to resolve item_variation_store_offset.
Sourcepub fn advance_height_mapping_offset(&self) -> Nullable<Offset32>
pub fn advance_height_mapping_offset(&self) -> Nullable<Offset32>
Offset in bytes from the start of this table to the delta-set index mapping for advance heights (may be NULL).
Sourcepub fn advance_height_mapping(
&self,
) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
pub fn advance_height_mapping( &self, ) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
Attempt to resolve advance_height_mapping_offset.
Sourcepub fn tsb_mapping_offset(&self) -> Nullable<Offset32>
pub fn tsb_mapping_offset(&self) -> Nullable<Offset32>
Offset in bytes from the start of this table to the delta-set index mapping for top side bearings (may be NULL).
Sourcepub fn tsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
pub fn tsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
Attempt to resolve tsb_mapping_offset.
Sourcepub fn bsb_mapping_offset(&self) -> Nullable<Offset32>
pub fn bsb_mapping_offset(&self) -> Nullable<Offset32>
Offset in bytes from the start of this table to the delta-set index mapping for bottom side bearings (may be NULL).
Sourcepub fn bsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
pub fn bsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
Attempt to resolve bsb_mapping_offset.
Sourcepub fn v_org_mapping_offset(&self) -> Nullable<Offset32>
pub fn v_org_mapping_offset(&self) -> Nullable<Offset32>
Offset in bytes from the start of this table to the delta-set index mapping for Y coordinates of vertical origins (may be NULL).
Sourcepub fn v_org_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
pub fn v_org_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
Attempt to resolve v_org_mapping_offset.
pub fn version_byte_range(&self) -> Range<usize> ⓘ
pub fn item_variation_store_offset_byte_range(&self) -> Range<usize> ⓘ
pub fn advance_height_mapping_offset_byte_range(&self) -> Range<usize> ⓘ
pub fn tsb_mapping_offset_byte_range(&self) -> Range<usize> ⓘ
pub fn bsb_mapping_offset_byte_range(&self) -> Range<usize> ⓘ
pub fn v_org_mapping_offset_byte_range(&self) -> Range<usize> ⓘ
Source§impl Vvar<'_>
impl Vvar<'_>
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 table
order, and returns how many were written.
See ItemVariationStore::compute_scalars for what out receives.
Sourcepub fn advance_delta(
&self,
glyph_id: GlyphId,
coords: &[F2Dot14],
) -> Option<F48Dot16>
pub fn advance_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Option<F48Dot16>
Returns the change a location makes to the advance height of a glyph.
The value carries every bit the item variation store computed. It is a caller that decides how to round it into a whole design unit, and implementations differ on that.
Returns None where the table says nothing readable about the glyph.
Sourcepub fn advance_delta_with_scalars(
&self,
glyph_id: GlyphId,
coords: &[F2Dot14],
scalars: &[Fixed],
) -> Option<F48Dot16>
pub fn advance_delta_with_scalars( &self, glyph_id: GlyphId, coords: &[F2Dot14], scalars: &[Fixed], ) -> Option<F48Dot16>
Returns the change a location makes to the advance height of a glyph, reusing
scalars.
scalars holds one entry per variation region, from
compute_scalars.
Sourcepub fn tsb_delta(
&self,
glyph_id: GlyphId,
coords: &[F2Dot14],
) -> Option<F48Dot16>
pub fn tsb_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Option<F48Dot16>
Returns the change a location makes to the top side bearing of a glyph.
The value carries every bit the item variation store computed. It is a caller that decides how to round it into a whole design unit, and implementations differ on that.
Returns None where the table says nothing readable about the glyph.
Sourcepub fn tsb_delta_with_scalars(
&self,
glyph_id: GlyphId,
coords: &[F2Dot14],
scalars: &[Fixed],
) -> Option<F48Dot16>
pub fn tsb_delta_with_scalars( &self, glyph_id: GlyphId, coords: &[F2Dot14], scalars: &[Fixed], ) -> Option<F48Dot16>
Returns the change a location makes to the top side bearing of a glyph, reusing
scalars.
scalars holds one entry per variation region, from
compute_scalars.
Sourcepub fn bsb_delta(
&self,
glyph_id: GlyphId,
coords: &[F2Dot14],
) -> Option<F48Dot16>
pub fn bsb_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Option<F48Dot16>
Returns the change a location makes to the bottom side bearing of a glyph.
The value carries every bit the item variation store computed. It is a caller that decides how to round it into a whole design unit, and implementations differ on that.
Returns None where the table says nothing readable about the glyph.
Sourcepub fn bsb_delta_with_scalars(
&self,
glyph_id: GlyphId,
coords: &[F2Dot14],
scalars: &[Fixed],
) -> Option<F48Dot16>
pub fn bsb_delta_with_scalars( &self, glyph_id: GlyphId, coords: &[F2Dot14], scalars: &[Fixed], ) -> Option<F48Dot16>
Returns the change a location makes to the bottom side bearing of a glyph, reusing
scalars.
scalars holds one entry per variation region, from
compute_scalars.
Sourcepub fn v_origin_y_delta(
&self,
glyph_id: GlyphId,
coords: &[F2Dot14],
) -> Option<F48Dot16>
pub fn v_origin_y_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Option<F48Dot16>
Returns the change a location makes to the y coordinate of the vertical origin of a glyph.
The value carries every bit the item variation store computed. It is a caller that decides how to round it into a whole design unit, and implementations differ on that.
Returns None where the table says nothing readable about the glyph.
Sourcepub fn v_origin_y_delta_with_scalars(
&self,
glyph_id: GlyphId,
coords: &[F2Dot14],
scalars: &[Fixed],
) -> Option<F48Dot16>
pub fn v_origin_y_delta_with_scalars( &self, glyph_id: GlyphId, coords: &[F2Dot14], scalars: &[Fixed], ) -> Option<F48Dot16>
Returns the change a location makes to the y coordinate of the vertical origin of a glyph, reusing
scalars.
scalars holds one entry per variation region, from
compute_scalars.