I’m developing a variable font with weights variation.
I’m currently try to play with different lettershapes that change from weight to another without smooth variations but with a leap, a discrete variation. For that purpose I create two different and consecutive masters (750=MasterA, 751=MasterB). It’s working fine in illustrator, but when I try it in chrome is not working anymore: by setting the value 751 the shapes are distorted, and when I inspect the code the actual value I see is not 751 but 750,80. Is there a way to avoid chrome to use floating value?
Have you tried using alternate layers? Otherwise, for variable fonts, consider using the
rvrn feature. Add the feature in Font Info > Features. Let’s say you have a weight axis (axis tag:
wght) from 200 to 900 and you want the shapes to switch at 750. The code would look like this:
condition 750 < wght; sub a by a.alt; sub b by b.alt;
And so on. This means that you need to have an .alt (or whatever suffix you want to use) glyph for every glyph you want t substitute.
Does this make sense for your design? This technique would also mean your switching glyphs don’t need to be compatible with each other.
Please don’t suggest the
rvrn feature. This was discussed here several times.
Oh. Sorry. It was actually Rainer himself who introduced me to it last week on a project I shall try and find some threads explaining why it’s not a good idea. Thanks!
So basically I have to write the code posted above but in the rlig feature, if I understand correctly.
Thanks for the heads up. I missed the substitution tutorial. Sorry
Beware that this means you need to add the kerning for all substituted glyphs, as that will not simply be copied. Maybe consider using alternate layers (also known as bracket layers).
This tutorial should help you out, it covers multiple approaches: Glyphs Tutorials | Switching Shapes