Swapping glyph + alternate, including kerning

I have worked on a family with 18 weights. After completion, I was asked to swap some glyphs with their alternates… Is there an easy way to swap a glyph with its alternate, including kerning ?

If the glyphs are in the same kerning class, they will get the same kerning. Glyph kerning (exceptions are attached to the glyphs and not to the name. So if you have a kern pair T+o and a different pair T+o.alt, and then replace the o with the o.alt, it will use the kerning from T+o.alt.

Just for some of the 18 fonts? Then you could replace glyphs with an instance parameter: https://www.glyphsapp.com/tutorials/alternating-glyph-shapes-with-multiple-axes

The fonts have already been mastered & checked… And I need it done for all weights.

Re-generating them would only be an option if I have to do everything manually, but only to use the altered kerning.

The glyphs are the /one, /two and /three as proportional lining & oldstyle. The /two & /two.ss01 (lf+osf) have the same right class, but the left one is different. Same for the /three & /three.ss01 (lf+osf) etc. The /one & /one.ss01 (lf+osf) are not in the same classes.

You mean you like to modify a .otf font?

No !

I made standalone files of all intermediate weights. Checked rounding failures, kerning etc.

You can add a ‘Replace Glyphs’ parameter to those files, too.

Will it then swap the glyphs, or just replace and rule out ?

It will replace them. You still need the original glyphs in the font? That you need to do manually (for now).

Has there been any advancements with swapping glyphs and their alternates? I have a similar issue, a need to swap glyphs: default glyph to alternate glyph and alternate glyph to default glyph. The mastering would only come after this, so a filter replacement doesn’t work in this case. Default and alternates don’t belong to the same kerning classes. There’s so many glyphs to be swapped that manual way would take days + is prone to errors.

Replace Glyphs now actually swaps glyphs. Try it.

Ok, I will. But is it a script or plugin or what? I have Glyphs version 2.4.1

As described in this very thread, it is the custom parameter Replace Glyphs. See the Appendix of the Handbook for details.

You must mean Rename Glyphs? Thanks I’ll try it.

Sorry, yes, Rename Glyphs.

Rename Glyphs works very well, but applies only to the generated instances. Is there any way to do the same to the masters, before generating instances?

Why would you like to do that?

You would need to write a script to do that.

Well, just rename the glyphs then.