pub struct NamedInstance<'a> {
index: u32,
axes: &'a [VariationAxisRecord],
coordinates: &'a [BigEndian<Fixed>],
subfamily_name: NameId,
postscript_name: Option<NameId>,
}Expand description
A named location in a variable font, such as “Bold” or “Condensed Light”.
It has one user space value per axis. Use
InstanceBuilder::named_instance
to create a font at this location.
Fields§
§index: u32§axes: &'a [VariationAxisRecord]§coordinates: &'a [BigEndian<Fixed>]§subfamily_name: NameId§postscript_name: Option<NameId>Implementations§
Source§impl<'a> NamedInstance<'a>
impl<'a> NamedInstance<'a>
Sourcepub fn index(&self) -> u32
pub fn index(&self) -> u32
Returns the index of the instance in the font’s list of named instances.
Sourcepub fn subfamily_name(&self) -> NameId
pub fn subfamily_name(&self) -> NameId
Returns the name table ID for the instance’s subfamily name.
Sourcepub fn postscript_name(&self) -> Option<NameId>
pub fn postscript_name(&self) -> Option<NameId>
Returns the name table ID for the instance’s PostScript name, if it
has one.
Sourcepub fn user_coords(&self) -> impl Iterator<Item = f32> + 'a + Clone
pub fn user_coords(&self) -> impl Iterator<Item = f32> + 'a + Clone
Returns the instance’s value on each axis, in font axis order.
Sourcepub fn variations(&self) -> impl Iterator<Item = Variation> + 'a + Clone
pub fn variations(&self) -> impl Iterator<Item = Variation> + 'a + Clone
Returns the instance’s value on each axis, paired with the axis tag.
Trait Implementations§
Source§impl<'a> Clone for NamedInstance<'a>
impl<'a> Clone for NamedInstance<'a>
Source§fn clone(&self) -> NamedInstance<'a>
fn clone(&self) -> NamedInstance<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for NamedInstance<'a>
Auto Trait Implementations§
impl<'a> Freeze for NamedInstance<'a>
impl<'a> RefUnwindSafe for NamedInstance<'a>
impl<'a> Send for NamedInstance<'a>
impl<'a> Sync for NamedInstance<'a>
impl<'a> Unpin for NamedInstance<'a>
impl<'a> UnsafeUnpin for NamedInstance<'a>
impl<'a> UnwindSafe for NamedInstance<'a>
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
Mutably borrows from an owned value. Read more