googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
151 stars 43 forks source link

mark2liga missing from binary font #663

Closed yanone closed 1 year ago

yanone commented 1 year ago

Here’s another anomaly with ufo2ft and my proprietary font (see https://github.com/googlefonts/ufo2ft/issues/658):

The feature code as output by --debug-feature-file does contain ligature attachments:

        pos ligature lam_alef-ar
                <anchor 330 -56> mark @MC_bottom
                <anchor 430 742> mark @MC_top
            ligComponent
                <anchor 123 -56> mark @MC_bottom
                <anchor 111 613> mark @MC_top;

But the binary file doesn't contain ligature attachment, only base attachment:

Bildschirmfoto 2022-10-05 um 17 00 13

I’ve searched the output of otf2fea and also couldn’t find any pos ligature statements, so I truly believe they are missing from the font.

This is happening both in ufo2ft=2.28.0 as well as with the repository’s main. Please let me know if I can be of any help in debugging this.

anthrotype commented 1 year ago

that's strange. When you dump with ttx do you not see any LookupType="5" (for MarkToLigature lookup subtables) in GPOS LookupList? Is this a VF or a static font? Try to see if you can reproduce with a minimal glyph set. If it stills has the issue, maybe remove the actual glyph drawings and upload a reproducer here, stripped of any proprietary stuff.

yanone commented 1 year ago

Reducing the font to the bare minimum actually helped me find the issue: The lam_alef ligature shown is actually the result of a contextual substitution that shows a lower alef when marks are present. This lam_alef-ar.short wasn’t getting categorized as a ligature by Georg’s WIP glyphsLib branch that I need for the RTL kerning. If I set the subCategory in Glyphs explicitly, it works. I've added a test case to Georg’s branch.