I’ve got a script I’ve been using for years for making “alt” versions of fonts. It swaps glyph names between default and alternate glyphs, among other things. It’s been working fine for some fonts (Proxima Nova is the one I use it with most often), but it’s not working right for others.
Here’s what the main swap code looks like:
font = Glyphs.font font.disableUpdateInterface() for g1Name in swapList.keys(): g2Name = swapList[g1Name] # second item print g1Name, g2Name g1 = font.glyphs[g1Name] g2 = font.glyphs[g2Name] g2.name = "temp" g1.name = g2Name g2.name = g1Name
(swapList is a dictionary loaded from one or more external text files containing a pair of glyph names on each line.)
The font it’s not working in has 6 masters. When I run the script, composite glyphs are not modified consistently between masters, so I end up with glyphs getting swapped in some masters but not others. For example, this is after running the script:
In the above screenshot, the accented characters should match the base character (which has been correctly swapped) in each of these sets of five characters, but they don’t. It’s a complete mess. I could manually fix each character, but the whole point of the script was to do it all automatically.
Has something changed in the way renaming glyphs works? This script worked flawlessly the last time I used it (about three years ago). I use the same script (except for the swap data) with Proxima Nova, and it still works fine.
Note: I’m seeing this issue in Glyphs version 2.6.2 (1268).