add contextual alternatives
This commit is contained in:
parent
50373cd6d7
commit
f5879b3425
2 changed files with 8 additions and 0 deletions
|
|
@ -134,6 +134,8 @@ pub struct FontFeatures {
|
|||
pub standard_ligatures: bool,
|
||||
/// Contextual ligatures (context-dependent ligatures)
|
||||
pub contextual_ligatures: bool,
|
||||
/// Contextual alternates (glyph substitutions based on context)
|
||||
pub contextual_alternates: bool,
|
||||
/// Discretionary ligatures (optional stylistic ligatures)
|
||||
pub discretionary_ligatures: bool,
|
||||
}
|
||||
|
|
@ -145,6 +147,7 @@ impl FontFeatures {
|
|||
kerning: true,
|
||||
standard_ligatures: true,
|
||||
contextual_ligatures: true,
|
||||
contextual_alternates: true,
|
||||
discretionary_ligatures: true,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,6 +158,11 @@ fn shape_fallback(
|
|||
attrs.font_features.contextual_ligatures as u32,
|
||||
0..usize::MAX,
|
||||
));
|
||||
features.push(rustybuzz::Feature::new(
|
||||
rustybuzz::ttf_parser::Tag::from_bytes(b"calt"),
|
||||
attrs.font_features.contextual_alternates as u32,
|
||||
0..usize::MAX,
|
||||
));
|
||||
features.push(rustybuzz::Feature::new(
|
||||
rustybuzz::ttf_parser::Tag::from_bytes(b"dlig"),
|
||||
attrs.font_features.discretionary_ligatures as u32,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue