Alternate layers / FeatureVariations glyphs not taking part in mark attachment
Closed this issue · 1 comments
I just noticed that although my base layers in a variable Oriya font were attaching nicely in a blwm
mark-to-mark feature, alternate layers were not:
This turns out to be because we build a mark filtering class for mark features like so:
ufo2ft/Lib/ufo2ft/featureWriters/markFeatureWriter.py
Lines 678 to 679 in 0f123a7
where include is something like this:
ufo2ft/Lib/ufo2ft/featureWriters/markFeatureWriter.py
Lines 828 to 831 in 0f123a7
However:
In [10]: lookupName
Out[10]: 'blwm_mark2mark_bottom'
In [11]: include
Out[11]: <function ufo2ft.featureWriters.markFeatureWriter.MarkFeatureWriter._makeFeatures.<locals>.isAbvm(glyphName)>
In [12]: include("lVocalicMatra-oriya")
Out[12]: True
In [13]: include("lVocalicMatra-oriya.BRACKET.varAlt01")
Out[13]: False
lVocalicMatra-oriya
is included in the glyph set because it has a Unicode encoded codepoint pointing to an abvm-using script; and anything reachable by GSUB substitutions from that codepoint is also included:
ufo2ft/Lib/ufo2ft/featureWriters/markFeatureWriter.py
Lines 878 to 883 in 0f123a7
But (and here I'm guessing slightly but it's a reasonable guess) lVocalicMatra-oriya.BRACKET.varAlt01
is only reachable by feature variations, so is not included, so does not take part in mark attachment.
I think the fix here is that either compileGSUB
or classifyGlyphs
or both need to know more about feature variations.
Oh wait. That's not possible, because feature variations only exist in the designspace and we're compiling UFOs; there's no link between lVocalicMatra-oriya
and lVocalicMatra-oriya.BRACKET.varAlt01
in the UFO.
Score another one for "you can't build a variable font by treating UFOs as independent fonts".