#[repr(C)]pub struct Feature {
pub tag: Tag,
pub value: u32,
pub start: u32,
pub end: u32,
}Expand description
An OpenType feature and the text range where it applies.
Fields§
§tag: TagOpenType feature tag.
value: u32Value assigned to the feature, usually 0 to disable or 1 to enable it.
start: u32First cluster index to which the feature applies.
end: u32Upper cluster index of the feature’s range.
Implementations§
Source§impl Feature
impl Feature
Sourcepub const GLOBAL_START: u32 = 0
pub const GLOBAL_START: u32 = 0
Start index for a feature that applies to the whole buffer.
Sourcepub const GLOBAL_END: u32 = u32::MAX
pub const GLOBAL_END: u32 = u32::MAX
End index for a feature that applies to the whole buffer.
Sourcepub fn new(tag: Tag, value: u32, range: impl RangeBounds<usize>) -> Feature
pub fn new(tag: Tag, value: u32, range: impl RangeBounds<usize>) -> Feature
Creates a feature for the given tag, value, and cluster range.
pub(crate) fn is_global(&self) -> bool
Trait Implementations§
impl Copy for Feature
Source§impl FromStr for Feature
impl FromStr for Feature
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses HarfBuzz feature syntax.
Possible values:
kernand+kernenable kerning globally.-kernandkern=0disable it globally.aalt=2selects value 2 for theaaltfeature.kern[5:]applies from cluster 5 onward.kern[3:5]applies to clusters 3 and 4.kern[3]applies to cluster 3.
Source§impl ParseSetting for Feature
impl ParseSetting for Feature
impl StructuralPartialEq for Feature
Auto Trait Implementations§
impl Freeze for Feature
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnsafeUnpin for Feature
impl UnwindSafe for Feature
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