You need to duplicate all glyphs, in this case, and use OpenType substitutions in order to trigger switches. The duplicated glyphs have the other outlines, while the base glyphs need to stay compatible with the other masters.
You can define rules such as “switch these glyphs if the weight axis reaches more than 500”, etc.
This setup is quite complicated though, so be sure to think whether you really need it.
I don’t really understand. ExtraLight to ExtraBold should interpolate. But what should happen when you put the variation slider below ExtraLight? Should it jump to Thin and don’t interpolate?
What you need is a second ExtraLight that is compatible with Thin to be variable in that range. The same between ExtraBold and Black. But to be able to build a proper variable fonts, you need at least a something in the Regular (or whatever you pick as the origin) for both extra ranges (it might be a copy of the ExtraLight/ExtraBold).
To put all this together is very tricky.
Yes exactly, when I put the variation slider below Extralight (200) it should directly switch to Thin (199) without interpolation. The same with Extrabold (730), when I put the slider over 730 it should just jump to Black (731).
Everything between 200-730 is an interpolation of the two Masters Light (200) and Extrabold (730).
So it seems Sebastians solution, duplicating the Light Master and using it for ExtraLight and substitute every glyph with an ss01 alternate and also with ExtraBold/Black might be the “best” option?
Haha, no, not really.
The extreme masters are just completely different in the shapes of the glyphs. Let’s say you have some kind of a font that in the extreme light is weathered and missing paths (like a stencil design) and in the black style is completely closed and has no more “holes”, like a blob. from my point of view, I don’t know how such extremes could be interpolated.
It’s the only one that is technically possible, yes.
Duplicate all glyphs, give them a suffix that is clear to you.
Select all non-suffixed glyphs, and in the Thin master click “Re-Interpolate”. That will generate compatible outlines in that master. Do the same for Black. Don’t worry, these shapes won’t be visible in the final font.
Write feature code (in rlig) that swaps the default with the suffxed glyphs for a cspecified axis location.
The syntax looks like this:
#ifdef VARIABLE
condition wght < 100;
sub a by a.suffix;
sub b by b.suffix;
...
#endif
I’m not sure off the top of my head whether you can do “or” statements like condition wght < 100 or 800 < wght;, but maybe somebody else can clarify this.
I still would expect some interpolation in the edge masters. In the glyph for the Thin shapes, make a Extralight that is as thick as the normal ExtraLight but starts to have holes (the shapes might slightly overlap still to make the jump less strong).
"Select all non-suffixed glyphs, and in the Thin master click “Re-Interpolate”. "
If I do, the selected glyphs are suddenly empty.
My approach with just three masters:
ExtraLight (200 wght)
Regular (400)
ExtraBold (730)
I duplicated the ExtraBold Master and renamed it to Black with a weight of 731
I just selected one letter in Black master, let’s say Thorn and duplicated it and renamed it to Thorn.black
I modified the Thorn.black glyph in the Black master. Of course it’s not compatible with any other Thorn.black master, right?
In the feature code, I wrote the following for rlig:
#ifdef VARIABLE
condition 731 < wght;
sub Thorn by Thorn.black;
#endif
So, if the slider is at 731, the substitution starts, right?
At all, I can’t export a variable font, because I get the error, that the Thorn.black is not compatible. What I am missing here?
That’s your problem. You need to make the masters in between compatible as well. Maybe just cope the Black master to your three in-between masters, it doesn’t really matter, because they won’t be visible anyway.
Yes okay, and theoretically, f I want to add another Master later, at the upper end, let’s say a Thin (100) Master …
Then I need, let’s say, a Thorn.thin, for all masters in the font and it’s only switching to Thorn.thin when the slider has a value, smaller as 100.
So I have a Thorn.black that is in all masters and compatible and I have a Thorn.thin, that is also in all masters and compatible?