pub struct FontFeatures { /* private fields */ }Expand description
A set of OpenType features requested for shaping.
Stack-allocated for the common case of ≤4 features.
Implementations§
Source§impl FontFeatures
impl FontFeatures
Sourcepub fn push(&mut self, feature: FontFeature)
pub fn push(&mut self, feature: FontFeature)
Add a feature to the set.
Sourcepub fn from_slice(features: &[FontFeature]) -> Self
pub fn from_slice(features: &[FontFeature]) -> Self
Create from a slice of features.
Sourcepub fn iter(&self) -> impl Iterator<Item = &FontFeature>
pub fn iter(&self) -> impl Iterator<Item = &FontFeature>
Iterate over features.
Sourcepub fn feature_value(&self, tag: [u8; 4]) -> Option<u32>
pub fn feature_value(&self, tag: [u8; 4]) -> Option<u32>
Return the value for a feature tag if present.
Sourcepub fn set_feature_value(&mut self, tag: [u8; 4], value: u32)
pub fn set_feature_value(&mut self, tag: [u8; 4], value: u32)
Insert or update a feature value by tag.
Sourcepub fn set_standard_ligatures(&mut self, enabled: bool)
pub fn set_standard_ligatures(&mut self, enabled: bool)
Toggle standard ligature features (liga, clig).
This explicit toggle is used by capability-gated fallback code so ligature behavior stays deterministic across runtimes.
Sourcepub fn standard_ligatures_enabled(&self) -> Option<bool>
pub fn standard_ligatures_enabled(&self) -> Option<bool>
Return explicit standard-ligature state if configured.
Some(true): all explicitly configured standard ligatures are on.Some(false): at least one explicit standard-ligature feature is off.None: no explicit standard-ligature feature was configured.
Sourcepub fn canonicalize(&mut self)
pub fn canonicalize(&mut self)
Sort features by tag for deterministic hashing.
Trait Implementations§
Source§impl Clone for FontFeatures
impl Clone for FontFeatures
Source§fn clone(&self) -> FontFeatures
fn clone(&self) -> FontFeatures
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 FontFeatures
impl Debug for FontFeatures
Source§impl Default for FontFeatures
impl Default for FontFeatures
Source§fn default() -> FontFeatures
fn default() -> FontFeatures
Returns the “default value” for a type. Read more
Source§impl Hash for FontFeatures
impl Hash for FontFeatures
Source§impl PartialEq for FontFeatures
impl PartialEq for FontFeatures
impl Eq for FontFeatures
impl StructuralPartialEq for FontFeatures
Auto Trait Implementations§
impl Freeze for FontFeatures
impl RefUnwindSafe for FontFeatures
impl Send for FontFeatures
impl Sync for FontFeatures
impl Unpin for FontFeatures
impl UnsafeUnpin for FontFeatures
impl UnwindSafe for FontFeatures
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.