pub struct ShaperInstance { /* private fields */ }
Expand description
An instance of a variable font.
Implementations§
Source§impl ShaperInstance
impl ShaperInstance
Sourcepub fn from_variations<V>(font: &FontRef<'_>, variations: V) -> Self
pub fn from_variations<V>(font: &FontRef<'_>, variations: V) -> Self
Creates a new shaper instance for the given font from the specified list of variation settings.
The setting values are in user space and the order is insignificant.
Sourcepub fn from_coords(
font: &FontRef<'_>,
coords: impl IntoIterator<Item = NormalizedCoord>,
) -> Self
pub fn from_coords( font: &FontRef<'_>, coords: impl IntoIterator<Item = NormalizedCoord>, ) -> Self
Creates a new shaper instance for the given font from the specified set of normalized coordinates.
The sequence of coordinates is expected to be in axis order.
Sourcepub fn from_named_instance(font: &FontRef<'_>, index: usize) -> Self
pub fn from_named_instance(font: &FontRef<'_>, index: usize) -> Self
Creates a new shaper instance for the given font using the variation position from the named instance at the specified index.
Sourcepub fn set_variations<V>(&mut self, font: &FontRef<'_>, variations: V)
pub fn set_variations<V>(&mut self, font: &FontRef<'_>, variations: V)
Resets the instance for the given font and variation settings.
Sourcepub fn set_coords(
&mut self,
font: &FontRef<'_>,
coords: impl IntoIterator<Item = F2Dot14>,
)
pub fn set_coords( &mut self, font: &FontRef<'_>, coords: impl IntoIterator<Item = F2Dot14>, )
Resets the instance for the given font and normalized coordinates.
Sourcepub fn set_named_instance(&mut self, font: &FontRef<'_>, index: usize)
pub fn set_named_instance(&mut self, font: &FontRef<'_>, index: usize)
Resets the instance for the given font using the variation position from the named instance at the specified index.
Trait Implementations§
Source§impl Clone for ShaperInstance
impl Clone for ShaperInstance
Source§fn clone(&self) -> ShaperInstance
fn clone(&self) -> ShaperInstance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ShaperInstance
impl Debug for ShaperInstance
Source§impl Default for ShaperInstance
impl Default for ShaperInstance
Source§fn default() -> ShaperInstance
fn default() -> ShaperInstance
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ShaperInstance
impl RefUnwindSafe for ShaperInstance
impl Send for ShaperInstance
impl Sync for ShaperInstance
impl Unpin for ShaperInstance
impl UnwindSafe for ShaperInstance
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