Hello, I’m trying to use predicate tokens to generate class members by matching against component names. These all work and opt+click shows a correct preview of all matching exporting glyphs:
@Tails = [$[name == "reh-ar" OR ANY layer0.componentNames LIKE "*reh*"]];
@Tails = [$[ANY layer0.componentNames LIKE "*reh*"]];
However, after exporting the font, the first example returns only uni0631 in the generated code, and the other 2 examples return empty sets.
I tried defining the class in a prefix, and as part of the classes UI, and also tried inlining it. All attempts to match against layer0.componentNames compile to an empty set despite the UI showing the correct preview.
When you mentioned that it works with TT but not with OTF fonts, I thought it might be that the components are already decomposed by the time the features are compiled.
Upon checking the generated fonts, you’re right, it doesn’t even compile correctly for TTF, it’s skipping glyphs that end up decomposed.
But this doesn’t make sense from a user perspective, and from reading the tokens tutorials. I thought predicate tokens were like preprocessor directives that act at the source level, easing manual labour of picking and filtering glyphs, regardless of what the final export ends up containing.
It is also doubly confusing because the preview shows something, and the export does something else. Even a simple $[hasComponents == true] ends up skipping those.
I’m sure there are reasons for this, but perhaps there could be a flag to specify the stage at which these tokens get processed?
The predicates need to be applied on the final font (if you use anchor or metrics tokens). But before decomposition. I didn’t think about that, yet. I’ll see what I can do.