Need help with two rlig features

I have two rlig features that interfere with each other and I can’t figure out how to make them work together.

The font has:

  • opsz axis ranging from 12 to 48
  • single- and double-storey forms of letter “a”
  • rlig feature (manual) to substitute “a” form depending on opsz value
  • rlig feature (automatic) for Arabic ligatures

Here’s the manual rlig for “a” substitution, where default “a” is a single-storey form for large optical size, and “a.ss01” is a double-storey form for small optical size. This part works well.

#ifdef VARIABLE
condition opsz < 24;
sub a by a.ss01;
sub aacute by aacute.ss01;
sub abreve by abreve.ss01;
sub acaron by acaron.ss01;
sub acircumflex by acircumflex.ss01;
sub adieresis by adieresis.ss01;
sub agrave by agrave.ss01;
sub amacron by amacron.ss01;
sub aogonek by aogonek.ss01;
sub aring by aring.ss01;
sub atilde by atilde.ss01;
#endif

And here’s the automatic rlig for Arabic ligatures:

lookup rlig_arab_0 {
	lookupflag IgnoreMarks;
	sub lam-ar.init alef-ar.fina by lam_alef-ar;
	sub lam-ar.medi alef-ar.fina by lam_alef-ar.fina;
	sub lam-ar.init alefHamzaabove-ar.fina by lam_alefHamzaabove-ar;
	sub lam-ar.medi alefHamzaabove-ar.fina by lam_alefHamzaabove-ar.fina;
	sub lam-ar.init alefHamzabelow-ar.fina by lam_alefHamzabelow-ar;
	sub lam-ar.medi alefHamzabelow-ar.fina by lam_alefHamzabelow-ar.fina;
	sub lam-ar.init alefMadda-ar.fina by lam_alefMadda-ar;
	sub lam-ar.medi alefMadda-ar.fina by lam_alefMadda-ar.fina;
	sub lam-ar.init alefWasla-ar.fina by lam_alefWasla-ar;
	sub lam-ar.medi alefWasla-ar.fina by lam_alefWasla-ar.fina;
} rlig_arab_0;

However, when opsz is below 24, Arabic ligatures stops substituting, so I see two separated lam-ar.init alef-ar.fina instead of one lam_alef-ar ligature. I tried to change the order of rligs but it makes no difference.

What could be a problem?
Should I wrap the first rlig (“a” substitution) into lookup as well?

Two rlig features are kind of broken (we are working on this). Use rclt for your manual code.

1 Like

Thank you.
I just tested and it works correct now.