When reporting a bug/issue:
When you open an issue for a change/improvement/feature request:
Describing the problem:
When Generating feature files for a font that has more than one lookup in one contextual rule, only the first lookup of that rule is written to the feature file, and all other lookups are discarded.
This problem affects the UFO generated with FontForge too.
FontForge Version: 20230101 a1dad3e Built: 2023-01-01 05:31 UTC-ML-TtfDb-D-GDK3
OS: Windows 10 Pro 22H2
Steps to reproduce:
- Start FontForge app and open a new font.
- Create 4 dummy glyphs (I created A, B, C, and D).

- Create 3 GSUB lookups (a single substitution 'Single 1' that replaces A by B, an other single substitution 'Single 2' that replaces C by D, and a contextual substitution By Glyphs that has the following rule: "A @<Single 1> C @<Single 2>", which will replace A by B and C by D if C camer after A.


- Save the newly created lookups, and then try them in a metrics window, to ensure that it is correctly created (We can see that the sequence "ABACD" is getting substituted by "ABBDD" as expected.)

- "Save Feature File..." and inspect its contents:
...
lookup caltContextualAlternatesinLatinlookup1 {
lookupflag 0;
sub \A'lookup Single1 \C' ;
} caltContextualAlternatesinLatinlookup1;
...
- We can see that the rule omitted the second lookup (Single2). Furthermore, removing old lookups from fontforge completely, and then trying to "Merge Feature Info..." of our previously exported feature file would change our substitution rules, and would not produce the same expected result in the test of step 4.
Expected behavior:
- The previously quoted contextual substitution lookup in the feature file should have the rule:
sub \A'lookup Single1 \C'lookup Single2 ;
Possible solution:
- I think this problem is related to the lookup_in_rule() function, where the condition to check in the for loop should be
seq > r->lookups[i].seq instead of seq < r->lookups[i].seq. Otherwise, the loop would never increment i.
When reporting a bug/issue:
When you open an issue for a change/improvement/feature request:
Describing the problem:
When Generating feature files for a font that has more than one lookup in one contextual rule, only the first lookup of that rule is written to the feature file, and all other lookups are discarded.
This problem affects the UFO generated with FontForge too.
FontForge Version: 20230101 a1dad3e Built: 2023-01-01 05:31 UTC-ML-TtfDb-D-GDK3
OS: Windows 10 Pro 22H2
Steps to reproduce:
Expected behavior:
Possible solution:
seq > r->lookups[i].seqinstead ofseq < r->lookups[i].seq. Otherwise, the loop would never incrementi.