Discrete axis support?

Does Glyphs support or plan to support discrete axes? I couldn’t find anything in the handbook or tutorials. I was thinking this could be a good solution for a “dark mode” axis (that is either on or off, no interpolation) to influence weight. But maybe there’s a better solution?

If there is no in-between design of the glyphs, wouldn’t a feature like a style set be a better choice?

Otherwise, you could make an axis that spans from 0 to 1. That is the approach I have seen most commonly.

Thanks, Florian! Is that a no to supporting discrete axes, then?

I think I see how this could be achieved with a standard axis ranging from 0 to 1 by setting up instances for the dark mode variants, with an axis location parameter of 0 for light/regular mode instances and 1 for dark, but is that not a bit of a hack or semantically incorrect for an axis that should not actually support a value between 0 and 1? Thinking toward the future, I could also see where tool makers (Adobe, Figma, etc) might eventually decide that discrete axes get a toggle, whereas regular axes get a slider…

What would it do?

There are plans for a Grade axis (current tag convention GRAD), would it be that?

That is certainly where I would put it.

The way I am thinking about it, it would adjust the weight of every instance to be a little bit lighter. But what it would not do is interpolate between those weights; just on or off, acting more as a boolean/toggle (i.e. how front-end engineers and web designers already think about it). I was under the impression that discrete axes are useful for this kind of boolean axis, but perhaps I am mistaken? Keeping users in mind, very few people who aren’t type designers know what GRAD is and I don’t know that I would use it for this if it’s avoidable.

What you’re describing is Grade with a negative value. Not sure if an unorthodox implementation is more user-friendly. And then what app developers are going to do in terms of UI, for which you have no way to influence.

In variable fonts, all glyphs need to be compatible (there are options to have multiple interpolations per glyph, but that is quite heavy, so you wouldn’t do that for all glyphs). So even if you don’t intend it, it will always be possible to interpolate. You can’t prevent people to set the axis to 0.5.

I may be misunderstanding how discrete axes can be used, but I thought the point of a discrete axis is that it is non-continuous? Isn’t one of the use cases for ital where glyphs are not compatible?

There are no discrete axes in OpenType. You either provide compatible outlines, which always allows the user to pick an in-between outlines if they really want to, or you switch the glyph for another glyph mid-interpolation, which does prevent the user from picking in-between outlines, but significantly increases the file size.

If you use case is a dark mode axis, offering a discrete axis is probably not a good idea anyway, since the degree of adjustment will vary depending on the font size, the background-to-foreground contrast ratio, and other factors like the display rendering.

Oh! So a discrete axis only exists in design space, but not in user space? I completely missed that while catching up on the v5 designspace document format

Oof, that’s a really good point, particularly around size. :thinking: Going back to Rainer’s comment, I guess user-friendliness would need to occur at the application layer rather than within the font itself… which would be easier on the web than elsewhere, e.g. by providing some CSS helpers or a React component (primary use case I have in mind) with a prop or context for dark mode that actually uses other axes (likely a combination of weight, and optical size - but potentially grade) under the hood. I wish I could have some kind of dark mode toggle for design apps, but it seems unrealistic.
I think I’ve wrapped my head around this; as always thank you all for your help and patience :pray:

That is not an issue of how you set up the axis but how the UI works that uses the font.

That would be two files.

Uh oh, I’m back to being confused again :laughing:
If there are no discreet axes in OpenType, how do UIs know how to handle them differently than continuous axes? Inference based on a range of 0-1?

Yes. And how axis are defined in the spec.

0-1 is still interpolatable.