#[non_exhaustive]pub struct ValueRecord {
pub x_placement: Option<i16>,
pub y_placement: Option<i16>,
pub x_advance: Option<i16>,
pub y_advance: Option<i16>,
pub x_placement_device: NullableOffsetMarker<DeviceOrVariationIndex>,
pub y_placement_device: NullableOffsetMarker<DeviceOrVariationIndex>,
pub x_advance_device: NullableOffsetMarker<DeviceOrVariationIndex>,
pub y_advance_device: NullableOffsetMarker<DeviceOrVariationIndex>,
/* private fields */
}
Expand description
GPOS subtables use ValueRecords to describe all the variables and values used to adjust the position of a glyph or set of glyphs. A ValueRecord may define any combination of X and Y values (in design units) to add to (positive values) or subtract from (negative values) the placement and advance values provided in the font. In non-variable fonts, a ValueRecord may also contain an offset to a Device table for each of the specified values. In a variable font, it may also contain an offset to a VariationIndex table for each of the specified values.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.x_placement: Option<i16>
§y_placement: Option<i16>
§x_advance: Option<i16>
§y_advance: Option<i16>
§x_placement_device: NullableOffsetMarker<DeviceOrVariationIndex>
§y_placement_device: NullableOffsetMarker<DeviceOrVariationIndex>
§x_advance_device: NullableOffsetMarker<DeviceOrVariationIndex>
§y_advance_device: NullableOffsetMarker<DeviceOrVariationIndex>
Implementations§
Source§impl ValueRecord
impl ValueRecord
pub fn new() -> ValueRecord
pub fn with_x_placement(self, val: i16) -> Self
pub fn with_y_placement(self, val: i16) -> Self
pub fn with_x_advance(self, val: i16) -> Self
pub fn with_y_advance(self, val: i16) -> Self
pub fn with_x_placement_device( self, val: impl Into<DeviceOrVariationIndex>, ) -> Self
pub fn with_y_placement_device( self, val: impl Into<DeviceOrVariationIndex>, ) -> Self
pub fn with_x_advance_device( self, val: impl Into<DeviceOrVariationIndex>, ) -> Self
pub fn with_y_advance_device( self, val: impl Into<DeviceOrVariationIndex>, ) -> Self
pub fn with_explicit_value_format(self, format: ValueFormat) -> Self
Sourcepub fn set_explicit_value_format(&mut self, format: ValueFormat)
pub fn set_explicit_value_format(&mut self, format: ValueFormat)
Set an explicit ValueFormat, overriding the computed format.
Use this method if you wish to write a ValueFormat that includes explicit null offsets for any of the device or variation index tables.
Sourcepub fn format(&self) -> ValueFormat
pub fn format(&self) -> ValueFormat
The ValueFormat of this record.
Sourcepub fn encoded_size(&self) -> usize
pub fn encoded_size(&self) -> usize
Return the number of bytes required to encode this value record
Trait Implementations§
Source§impl Clone for ValueRecord
impl Clone for ValueRecord
Source§fn clone(&self) -> ValueRecord
fn clone(&self) -> ValueRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ValueRecord
impl Debug for ValueRecord
Source§impl Default for ValueRecord
impl Default for ValueRecord
Source§fn default() -> ValueRecord
fn default() -> ValueRecord
Source§impl<'de> Deserialize<'de> for ValueRecord
impl<'de> Deserialize<'de> for ValueRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl FontWrite for ValueRecord
impl FontWrite for ValueRecord
Source§fn write_into(&self, writer: &mut TableWriter)
fn write_into(&self, writer: &mut TableWriter)
Source§fn table_type(&self) -> TableType
fn table_type(&self) -> TableType
Source§impl FromObjRef<ValueRecord> for ValueRecord
impl FromObjRef<ValueRecord> for ValueRecord
Source§fn from_obj_ref(from: &ValueRecord, data: FontData<'_>) -> Self
fn from_obj_ref(from: &ValueRecord, data: FontData<'_>) -> Self
from
to an instance of Self
, using the provided data to resolve offsets.Source§impl Hash for ValueRecord
impl Hash for ValueRecord
Source§impl Ord for ValueRecord
impl Ord for ValueRecord
Source§fn cmp(&self, other: &ValueRecord) -> Ordering
fn cmp(&self, other: &ValueRecord) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ValueRecord
impl PartialEq for ValueRecord
Source§impl PartialOrd for ValueRecord
impl PartialOrd for ValueRecord
Source§impl RemapVariationIndices for ValueRecord
impl RemapVariationIndices for ValueRecord
Source§fn remap_variation_indices(&mut self, key_map: &VariationIndexRemapping)
fn remap_variation_indices(&mut self, key_map: &VariationIndexRemapping)
TemporaryDeltaSetId
s to their final VariationIndex
valuesSource§impl Serialize for ValueRecord
impl Serialize for ValueRecord
Source§impl Validate for ValueRecord
impl Validate for ValueRecord
Source§fn validate_impl(&self, _ctx: &mut ValidationCtx)
fn validate_impl(&self, _ctx: &mut ValidationCtx)
impl Eq for ValueRecord
impl StructuralPartialEq for ValueRecord
Auto Trait Implementations§
impl Freeze for ValueRecord
impl RefUnwindSafe for ValueRecord
impl Send for ValueRecord
impl Sync for ValueRecord
impl Unpin for ValueRecord
impl UnwindSafe for ValueRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T
, using the provided data to resolve any offsets.