googlefonts / ufo2ft

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

Mark feature writer doesn't mkmk correctly when both abvm and mark scripts in font #754

Open simoncozens opened 1 year ago

simoncozens commented 1 year ago

Okay, this is slightly complicated, but when the attached Glyphs File MarkMarkTest.glyphs.gz (a subset of Noto Sans Tagalog) is compiled with fontmake, the resulting feature file looks like this:

markClass uni1712 <anchor -171 693> @MC_Anchor2;

feature abvm {
    lookup abvm_mark2base {
        pos base uni170A
            <anchor 488 693> mark @MC_Anchor2;
    } abvm_mark2base;

    lookup abvm_mark2mark_Anchor2 {
        @MFS_abvm_mark2mark_Anchor2 = [uni1712];
        lookupflag UseMarkFilteringSet @MFS_abvm_mark2mark_Anchor2;
        pos mark uni1712
            <anchor 27 693> mark @MC_Anchor2;
    } abvm_mark2mark_Anchor2;

} abvm;

feature mark {
    lookup mark2base {
        pos base uni25CC
            <anchor 300 590> mark @MC_Anchor2;
    } mark2base;

} mark;

table GDEF {
    GlyphClassDef [uni170A uni25CC], [], [uni1712], [];
} GDEF;

Notice that we have mark-to-base and mark-to-marks rule in the Tagalog part of the font that goes through the abvm feature, but we only have mark-to-base, and no mark-to-mark, for the dotted circle bit, leading to:

$ shape master_ttf/MarkMarkTest-Regular.ttf -u 170a,1712,1712,25cc,1712,1712

shape

I think there should be a mkmk feature produced as well.