The Birdfont Source Code
Run contextual ligature substitution before the non-contextual substitutions
These changes was commited to the Birdfont repository Wed, 25 Mar 2015 18:28:14 +0000.
Contributing
Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
Run contextual ligature substitution before the non-contextual substitutions
--- a/libbirdfont/GlyphSequence.vala
+++ b/libbirdfont/GlyphSequence.vala
@@ -68,17 +68,17 @@
// skip ligature substitution if this sequence contains ranges
if (has_range) {
return ligature_sequence;
+ }
+
+ foreach (ContextualLigature c in ligatures.contextual_ligatures) {
+ ligature_sequence.replace_contextual (c.get_backtrack (),
+ c.get_input (), c.get_lookahead (), c.get_ligature_sequence ());
}
ligatures = font.get_ligatures ();
ligatures.get_single_substitution_ligatures ((substitute, ligature) => {
ligature_sequence.replace (substitute, ligature);
});
-
- foreach (ContextualLigature c in ligatures.contextual_ligatures) {
- ligature_sequence.replace_contextual (c.get_backtrack (),
- c.get_input (), c.get_lookahead (), c.get_ligature_sequence ());
- }
ligature_sequence.ranges.clear ();
for (int i = 0; i < ligature_sequence.glyph.size; i++) {