Can my variable font axis snap instead of slide?

Hello! I’m working on designing my first variable font and I’d like the styles to “snap” from one to the next instead of interpolating. I’ve set them up as whole numbers, so basically I’d like to eliminate the possibility of decimals in the selection. Problem is, I can’t figure out how to do this. Is it a Variable font setting? Do I need to do some scripting? Thanks!

Why do you want to make a variable font then? Where’s the point if you’re basically just allowing instances?

Just add the instances you like to export in the font info. This way you decide what Interpolations you want to allow

Adding the instances to the font info will not prevent the variable font from allowing interpolations between these defined axis locations.

It’s conceptual

That might be, but what is the point of a variable font if you are only selecting instances? What’s the difference to having instances instead? Can you describe in more detail what you are trying to achieve?

For conceptual reasons it’s just how I’d prefer to set it up if possible.

If it isn’t possible that’s fine. I’m just curious, and it seems like it should be possible. For example, I think I’ve seen it with italic fonts.

You could do it with feature variations. So you only have one master and the different versions are extra glyphs what you switch in with feature variation code.

So you have an “a” and an “a.extra” and use this code in the rlig feature.

#ifdef VARIABLE
condition 5 < wght < 10; 
sub a by a.extra;
#endif

(assuming the ‘wght’ axis is in the range of 0–10) This will show the “a” from 0–5 and “a.extra” for the rest.

And as you only have one master, you need to add an “Virtual Master” in the font setting on location 10.

1 Like

Keep in mind that the slider is not something that is done in the font. Rather, that is the third party app that uses the font. You cannot control what third party app developers are doing by making settings in your font. You may get a hack together but it may break in the next version of the app you hacked your font for.