Swap glyphs in variable typeface

I’m designing a variable typeface with 2 axis: weight and slant.
In the UltraLight and UL Italic Master/instances, I want to swap the curly comma (14 points) with a straight line comma (4 points). Also semicolon and all quotes glyphs.
There is no need for interpolation, only these 2 instances need to switch the glyphs.
It works for normal instances in OTF with https://glyphsapp.com/tutorials/alternating-glyph-shapes-with-multiple-axes
But I understand this method doesn’t work in Variable?

I’ve tried with the bracket trick without success:
“Ultralight [0]” layer in one or all masters… or should it be “Ultralight [0, 0]” and Ultralight [0, 100] for UltraLight Italic ?

I’ve read a few threads where it says it should work? … only on the first axis? … but a new version of Glyphs is coming out allowing more?
Information is a bit unclear. I guess I’m lost and confused. The tutorials being from 2015 and not explaining how it would work with multiple axis/variable doesn’t help.
Appreciate the help you can give me. A tutorial dedicated to alternating glyphs in variable fonts would be great (hopefully planned with the new version)!

It does. You need to be careful with pure composites though. So the bracket layers must be decomposed at the moment.

Hi mekkablue, thanks for the quick reply.

I meant the other method (Rename Glyphs custom parameter) doesn’t work with variable. I’ve just tried again, it works with OTFs, but not with a VF.

I tried the bracket trick just with the comma (not a composite) but didn’t manage to make it work.
You didn’t answer how it would have to be set up:
“Ultralight [0]” layer in one or all masters… or should it be “Ultralight [0, 0]” and Ultralight [0, 100] for UltraLight Italic ?

This will work, soon.

1 Like

Will there be a way to swap a glyph in a variable font depending on the axis coordinates of an instance? For example, I’d like to use a different layer (or preferably an alternate glyph) when the y-opaque (horizontal weight) is high or y-transparent (body height) is low.

Alright, thank you.

I actually managed to make it work on both axis with the bracket trick!
Ultralight [1]
Medium ]1]
Black ]1]
Ultralight Italic [1]
Medium Italic ]1]
Black Italic ]1]

Complicated implementation though, wouldn’t do that to all glyphs that use it as component. Looking forward to the new release to see how it would work.