Contextual alternative for bold(er) weights only

How is it possible to have a contextual alternative for only bolder weights?

I have an “eccentric” f that collides with letters like áăâä etc. In Regular, this is still fine, it only collides in bolder weights. So I would like to create a contextual alternate to avoid that, something like this, but it doesn’t work.

condition 120 < wght < 200;
sub [f f_f]' [abreve acircumflex adieresis agrave amacron atilde ccaron ccircumflex ebreve ecaron ecircumflex edieresis emacron etilde hbar iacute ibreve icircumflex idieresis idotaccent idotbelow igrave imacron iogonek itilde ij j jacute jcircumflex napostrophe ocircumflex odieresis ohungarumlaut omacron otilde rcaron scaron scircumflex ucircumflex uhungarumlaut utilde ycircumflex ydieresis ymacron ytilde zcaron gbreve.ss02 gcaron.ss02 gcircumflex.ss02 ] by [f.ss02 f_f.ss02];

Any Idea?

Is this for a variable or static font?

in best case for both.

For variable fonts, you need to do something like you showed above.
For static instances, you need to add the code in a “Add Feature” parameter in the instances that should get the substitutions.

works perfectly, thanks :slight_smile:

I used this for the variable font

#ifdef VARIABLE
condition 120 < wght < 200;
sub [f f_f]' [abreve acircumflex adieresis agrave … ] by [f.ss02 f_f.ss02];
#endif