Struct write_fonts::tables::gpos::ValueRecord
source · #[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 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§fn eq(&self, other: &ValueRecord) -> bool
fn eq(&self, other: &ValueRecord) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for ValueRecord
impl PartialOrd for ValueRecord
source§fn partial_cmp(&self, other: &ValueRecord) -> Option<Ordering>
fn partial_cmp(&self, other: &ValueRecord) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§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)
TemporaryDeltaSetIds to their final VariationIndex valuessource§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 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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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.