pub struct Hvar<'a> {
data: FontData<'a>,
}Expand description
The HVAR (Horizontal Metrics Variations) table
Fields§
§data: FontData<'a>Implementations§
Source§impl<'a> Hvar<'a>
impl<'a> Hvar<'a>
pub const MIN_SIZE: usize
Sourcepub fn resolve_offset<O: Offset, R: FontRead<'a>>(
&self,
offset: O,
) -> Result<R, ReadError>
pub fn resolve_offset<O: Offset, R: FontRead<'a>>( &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
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_width_mapping_offset(&self) -> Nullable<Offset32>
pub fn advance_width_mapping_offset(&self) -> Nullable<Offset32>
Offset in bytes from the start of this table to the delta-set index mapping for advance widths (may be NULL).
Sourcepub fn advance_width_mapping(
&self,
) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
pub fn advance_width_mapping( &self, ) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
Attempt to resolve advance_width_mapping_offset.
Sourcepub fn lsb_mapping_offset(&self) -> Nullable<Offset32>
pub fn lsb_mapping_offset(&self) -> Nullable<Offset32>
Offset in bytes from the start of this table to the delta-set index mapping for left side bearings (may be NULL).
Sourcepub fn lsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
pub fn lsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
Attempt to resolve lsb_mapping_offset.
Sourcepub fn rsb_mapping_offset(&self) -> Nullable<Offset32>
pub fn rsb_mapping_offset(&self) -> Nullable<Offset32>
Offset in bytes from the start of this table to the delta-set index mapping for right side bearings (may be NULL).
Sourcepub fn rsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
pub fn rsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
Attempt to resolve rsb_mapping_offset.
pub fn version_byte_range(&self) -> Range<usize> ⓘ
pub fn item_variation_store_offset_byte_range(&self) -> Range<usize> ⓘ
pub fn advance_width_mapping_offset_byte_range(&self) -> Range<usize> ⓘ
pub fn lsb_mapping_offset_byte_range(&self) -> Range<usize> ⓘ
pub fn rsb_mapping_offset_byte_range(&self) -> Range<usize> ⓘ
Source§impl Hvar<'_>
impl Hvar<'_>
Sourcepub fn advance_width_delta(
&self,
glyph_id: GlyphId,
coords: &[F2Dot14],
) -> Result<Fixed, ReadError>
pub fn advance_width_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Result<Fixed, ReadError>
Returns the advance width delta for the specified glyph identifier and normalized variation coordinates.