pub struct SingleSubstStatement {
pub location: Range<usize>,
pub prefix: Vec<GlyphContainer>,
pub suffix: Vec<GlyphContainer>,
pub glyphs: Vec<GlyphContainer>,
pub replacement: Vec<GlyphContainer>,
pub force_chain: bool,
}Expand description
A single substitution (GSUB type 1) statement
Fields§
§location: Range<usize>The location of the statement in the source FEA.
prefix: Vec<GlyphContainer>The prefix (backtrack) glyphs
suffix: Vec<GlyphContainer>The suffix (lookahead) glyphs
glyphs: Vec<GlyphContainer>The glyphs to be substituted
Although this is a single substitution, there may be multiple
glyphs in e.g. sub [a b] by [c d]; where a and b are
both substituted by c and d respectively.
replacement: Vec<GlyphContainer>The replacement glyphs
force_chain: boolWhether to force this substitution to be treated as contextual
Implementations§
Source§impl SingleSubstStatement
impl SingleSubstStatement
Sourcepub fn new(
glyphs: Vec<GlyphContainer>,
replacement: Vec<GlyphContainer>,
prefix: Vec<GlyphContainer>,
suffix: Vec<GlyphContainer>,
location: Range<usize>,
force_chain: bool,
) -> Self
pub fn new( glyphs: Vec<GlyphContainer>, replacement: Vec<GlyphContainer>, prefix: Vec<GlyphContainer>, suffix: Vec<GlyphContainer>, location: Range<usize>, force_chain: bool, ) -> Self
Create a new single substitution statement.
Note the unusual argument order: prefix and suffix come after
the replacement glyphs. prefix, suffix, glyphs and
replacement should be lists of glyph-containing objects_. glyphs and
replacement should be one-item lists.
Trait Implementations§
Source§impl Clone for SingleSubstStatement
impl Clone for SingleSubstStatement
Source§fn clone(&self) -> SingleSubstStatement
fn clone(&self) -> SingleSubstStatement
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 SingleSubstStatement
impl Debug for SingleSubstStatement
Source§impl From<Gsub1> for SingleSubstStatement
impl From<Gsub1> for SingleSubstStatement
Source§impl PartialEq for SingleSubstStatement
impl PartialEq for SingleSubstStatement
impl Eq for SingleSubstStatement
impl StructuralPartialEq for SingleSubstStatement
Auto Trait Implementations§
impl Freeze for SingleSubstStatement
impl RefUnwindSafe for SingleSubstStatement
impl Send for SingleSubstStatement
impl Sync for SingleSubstStatement
impl Unpin for SingleSubstStatement
impl UnsafeUnpin for SingleSubstStatement
impl UnwindSafe for SingleSubstStatement
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§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.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
Convert this type into
T, using the provided data to resolve any offsets.