Toggle through 1 set of alternates


Hi there

I'm looking to add a simple alternate feature to a font. The font is purely uppercase but in the lowercase glyphs the font has one set of of alternates (also uppercase design).

We're not after any cutting edge attempts at randomisation, just a simple toggle effect, cycling through so every other time you type a letter the alternate displays. So typing "aaaa" will pull out "aAaA" from the glyphs.

I have looked through a lot of posts and articles and have found much useful information, but can't quite pin down the exact code. I understand it's quite simple and I'm almost there I think. I have created two classes - class1 (uppercase) and class2 (lowercase).

Now I believe I just need a simple piece of code to place here in the opentype panel:

feature xxxx {