Lookupflag adds to previous flags instead of overwriting them

I have the following feature code:

lookupflag UseMarkFilteringSet [hamzaabove-ar];
	ignore sub alef-ar' hamzaabove-ar lam-ar.init hah-ar.medi;
	sub alef-ar' lam-ar.init' hah-ar.medi' by alef_lam_hah-ar.init.liga;

lookupflag IgnoreMarks;
	sub [kaf-ar.init]' [alef-ar.fina kaf-ar.fina lam-ar.medi lam-ar.fina lam_alef-ar.fina] by [kaf-ar.init.001];

The second lookup should have only IgnoreMarks flag set, but in the exported fonts it has both IgnoreMarks and UseMarkFilteringSet from the previous lookup:

      <Lookup index="13">
        <LookupType value="6"/>
        <LookupFlag value="24"/><!-- ignoreMarks useMarkFilteringSet -->
        <!-- SubTableCount=1 -->
        <ChainContextSubst index="0" Format="3">
          <!-- BacktrackGlyphCount=0 -->
          <!-- InputGlyphCount=1 -->
          <InputCoverage index="0">
            <Glyph value="kaf-ar.init"/>
          <!-- LookAheadGlyphCount=1 -->
          <LookAheadCoverage index="0">
            <Glyph value="alef-ar.fina"/>
            <Glyph value="kaf-ar.fina"/>
            <Glyph value="lam-ar.fina"/>
            <Glyph value="lam-ar.medi"/>
            <Glyph value="lam_alef-ar.fina"/>
          <!-- SubstCount=1 -->
          <SubstLookupRecord index="0">
            <SequenceIndex value="0"/>
            <LookupListIndex value="16"/>
        <MarkFilteringSet value="0"/>

Fixed it. Thanks for the report!

1 Like

Thanks. If anyone else is looking for workaround, putting each lookup in an explicit lookup block fixes the issue as well.

Iā€™m still seeing this issue. (this time in a different font; the presence of a latin mkmk lookup breaks Arabic mkmk positioning because the latin uses UseMarkFilteringSet and it bleeds to the Arabic lookups).