I’m trying to add some Contextual Substitutions to just some of my instances. In the Glyphs 3 release post I saw two code snippets for this:
#ifdef VARIABLE
condition 600 < wght < 900, 70 < wdth < 90;
sub won by won.boldcondensed;
#endif
#ifndef VARIABLE
sub x by x.static; # ignored in variable fonts
#endif
The latter is supposed to only apply to static fonts, but the example has no conditions like the variable one. Naturally I tried this but it didn’t work:
#ifndef VARIABLE
condition 119 < wght < 168;
sub a b' by c;
#endif
What I want is the substitution to apply to all instances at weights above 119. Is this possible today? If so have I done something wrong?
I think what I want is something different, but it could be that I don’t understand how to apply it in my specific scenario. So let me explain.
I have /g, that looks different in the Bold weight compared to the other instances. That I’ve solved with Rename Glyphs parameter.
The Bold /g connects awkwardly to /j, so I’ve created a j.after.g that I want after each /g. The effect is a connecting /g and /j. But only in the Bold instance.
So I originally planned to put substitution in rlig(or where makes sense) within a #ifndef VARIABLE with conditions, only on bold. But as you said it’s not supported(yet at least).
My option is then to add a Custom Parameter to the Bold instance:
I tried Add Feature with calt, but it doesn’t work:
I did tested the code straight in the feature panel, and it works, so not sure if I’m doing something wrong. I have some calt features already, but no dlig. I’m testing in InDesign 2020.
Thanks Rainer.
And just so I understand how it’s intended to work. Add Feature shouldn’t override all existing feature code, right? It’s should append feature code in that case?