The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 25 Mar 2015 18:28:14 +0000 (19:28 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 25 Mar 2015 18:28:14 +0000 (19:28 +0100)
commit 068054100b01fbba90eba9b42a74945181bcddf4
tree 7e680d3fdb1358a4ed0d161d0a717492badbaa36
parent e5a3b4b369f85f91bc2a5ae5101715362f9fac88
Run contextual ligature substitution before the non-contextual substitutions

libbirdfont/GlyphSequence.vala
--- 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++) {