Closed dscorbett closed 2 years ago
I am literally dealing with this issue right now! (With that particular font, indeed.)
If you're doing exactly what I'm doing (and it does rather look like you're doing exactly what I'm doing), the new script otflayout2glyphs.py might prove useful.
See also fonttools/fonttools#2469.
The more relevant issue here is https://github.com/adobe-type-tools/afdko/issues/1167
The MTI rules call for the single subst to be applied first, and then the ligature lookup afterwards, which avoids the problem of the glyph positions changing. But in FEA chaining lookups are assumed to apply left to right. So in the general case this kind of rule cannot be decompiled for FEA.
(Or maybe that was Sharada. Very similar issue with multiple applications on the same chaining rule, anyway.)
I trusted the spec, but the spec lied. otf2fea is behaving correctly.
This changes the meaning of the rule.
MultipleSubstitution8
is supposed to apply to@class3
. otf2fea shows it as applying to@class2
because, afterLigatureSubstitution7
is applied, subsequent glyphs’ sequence indices are one less than what they were. However, example 1 of section 5.f.i of the feature file spec shows that lookup references are written immediately after the glyphs they apply to, without taking into account how other lookups change glyphs’ sequence indices. Therefore, otf2fea should decompile this rule to: