Variable Font : glyph with bracket layers not working in substitution OT features


it seems that this is not a Glyphs bug or my lack of technical skills but an implementation bug, but I want to make sure that the exported variable font is working properly. The bug appears in Firefox and Chrome, but not in Safari, InDesign or Illustrator. If there is an appropriate work-around, let me know.

When an OpenType feature substitutes a glyph containing bracket layers, the substitutional glyph jumps back to the actual glyph from the point where the bracket layer (in the actual glyph) should replace the main layer. The substitutional glyph itself may contain bracket layers, that’s not the problem. In my case the features c2sc and case are affected, but it might appear in others as well. I tried implementing a substitution of the .varAlt01 glyph (that is generated for the glyph of the bracket layers when exporting the variable font), but of course Glyphs doesn’t allow implementing features of glyphs that do not exist in the glyphs file.

Is there anything I can do? Or wouldn’t you consider this a defect of the variable font?


The problem is that the .varXX glyphs are substituted in the rvrn feature. That that is, pre spec, executed as first thing. So any substitutions that need to interact with those glyphs don’t work. The .var subs can be in any feature but it has to be one that is always active. There is a custom parameter to change the feature. The best feature is the rlig (as it is on by default and can be configured to be executed at the end of GPOS. BUT it is not supported by Adobe. So if you are making webfonts, use that.

Thanks a lot. Sorry, but I need a bit more explanation here.

I have difficulties to understand the rvrn feature. It looks like it only defines which glyphs are substituted, but not on what conditions. I don’t know how to take a look into the GSUB table (I tried FontTableViewer, but I can’t make it work), but I guess it’s somehow stored within the FeatureVariations table in there. For my substitution I need a condition, but I don’t need to edit the FeatureVariations table?

The automatically generated rvrn feature says sub X.varAlt01 by X;. When would that be needed? I want sub X by X.varAlt01; when weight exceeds the number from the brackets. When c2sc is active and the c2sc feature says sub X by; I want the the sub X.varAlt01 by;. If I write that in rlig wouldn’t it be active by default even if c2sc is not active? Also the .var referral doesn’t pass the compile/test.

What do you mean by “custom parameter to change the feature”? Change any feature to be always active (when not using rlig)? I don’t know any such feature. Implementing substitutions that need to interact with the .var glyphs in the rvrn feature which are not in the glyphs file?

If you decompile the feature, you only see the substitution and not the rules.

You don’t write any feature code yourself. Add the custom parameter and use “rlig” as value. Then the substitutions added by Glyphs will go in there and not in “rvrn”.

Can you please specify what you mean by “the custom parameter”? I assume you don’t mean any in the font tab, masters tab or instances tab. If you mean manually insert an OpenType feature in the features tab (and by value you mean name of the feature) then rlig doesn’t show the effect. If I leave the rlig feature empty, it disappears after export. If I copy in there the substitutions from the automatically generated rvrn feature, it is not accepted because of the not existing glyphs. If I tick the checkbox “generate automatically” in the rlig feature, the feature disappears.

Yes I mean adding a custom parameter in the font tab.
The features needed for the bracket layers is added independently from whatever is in the feature panel.

It sounds so logical, but all custom parameters available to select in the font tab don’t make sense to me for the described use. Which property do I use? Thanks again!

Try Feature for Feature Variations.

It works! Thank you guys for all the endurance and the support.

1 Like