In the following lookup, the lookup flag will be ignored which is different from FDK. In FDK it's not ignored.
lookup rlig_arab_0 {
lookupflag RightToLeft IgnoreMarks;
script arab;
sub arAlef arLamPF.i arLamPF.m arHehPF.f by arAllah;
} rlig_arab_0;
But if I move the flag after the script statement, it will be taken:
lookup rlig_arab_0 {
script arab;
lookupflag RightToLeft IgnoreMarks;
sub arAlef arLamPF.i arLamPF.m arHehPF.f by arAllah;
} rlig_arab_0;
This is not a major issue as long as the user knows about this difference. I had a situation that I couldn't find an explanation why my lookup flag is ignored in fontmake but not in makeotf.
script and language are not allowed in standalone lookups per the spec.
Assuming this is a nested lookup block (i.e. inside a feature block), the spec says:
The lookupflag attribute stays the same until explicitly changed, until a lookup reference statement is encountered that changes it, until the script is changed, or until the end of the feature.
So we need a complete test, it might be that the script is not changing (the current script is arab already), makeotf not actually following the spec.
Thank you Khaled, this was a nested lookup as you described. I can send you the UFO file to your email for your testing.
I can send you the UFO file to your email for your testing.
Yes, please.
I just sent you the file to your email, please let me know if you've received it or not.
Sorry for the delay, I got the files, and I checked what makeotf is doing, but got distracted. Will make a PR soon.
https://github.com/fonttools/fonttools/pull/1883 should fix the output to match makeotf's, but note that the first rlig lookup will still have its lookup flags reset (in both makeotf and feaLib) because the current script is different from the new one. Since all lookups in your rlig feature use the same script, you should set it outside the lookup blocks instead (also RightToLeft has effect only on cursive attachment lookups, it is ignored by layout engines for all other lookups, so you don鈥檛 need to set it).
Thank You Khaled, noted! Just for the reference I didn't write the feature, it's taken from an auto-generated feature of Glyphs app.
Allowing script and language statement inside nested lookups was really a bad idea, they are also feature-global and will affect subsequent lookups as well.
Most helpful comment
https://github.com/fonttools/fonttools/pull/1883 should fix the output to match makeotf's, but note that the first rlig lookup will still have its lookup flags reset (in both makeotf and feaLib) because the current script is different from the new one. Since all lookups in your rlig feature use the same script, you should set it outside the lookup blocks instead (also
RightToLefthas effect only on cursive attachment lookups, it is ignored by layout engines for all other lookups, so you don鈥檛 need to set it).