I used a font recently that had alternate glyphs assigned to each character. It was a handwritten font. Like someone scanned and traced a sample of their own handwriting. And I guess to make it look more convincing, each letter was scanned/traced several times.
So if you type the uppercase letter 'A' (or lowercase 'a', or whatever) four times in a row, it could appear as four similar, but slightly different (or sometimes quite different) variations. But it was only a single font. It also seemed to prefer a particular glyph variant at word boundaries. So, the first and last letter of each word might have elaborate flourishes or some fancy thing like that. In Adobe Illustrator, the alternates pop up as you type, and you get to pick & choose with the mouse.

Maybe this isn't uncommon, but it's the first time I've seen it. Anyway I'd like to create a new font of my own, or perhaps modify an existing one to utilize alternate glyphs in the same way. But how?

For example, this font is designed to look like the one from the iconic Coca Cola logo. But it can't really recreate the original because the original has two different "C" glyphs. Maybe that's not the best example, but you get the idea.

enter image description here

enter image description here

  • An excellent question! I will type an answer later, but for now, you can search for "The OpenType Cookbook", and check the Common Techniques > Fun Stuff > Randomization section. BE AWARE: OpenType feature programming is not easy at all.
    – Pepe Ochoa
    Feb 14, 2019 at 15:50
  • @PepeOchoa Thanks, I appreciate it. I'm no stranger to programming. Is it still likely to be difficult? PS: The font I used was a True Type Font (.ttf). It probably doesn't matter, but just FYI.
    – voices
    Feb 14, 2019 at 20:28

1 Answer 1


In general: you need to use OpenType features to make “intelligent” automatic replacements. So it needs to be an OpenType font. It can have a TTF or OTF suffix.

Taking your Coca-Cola example, there are two ways to achieve this effect:

  1. you replace certain strings with ligatures. This can be two characters like Co or entire words (like Cola) or phrases (like Coca-Cola). Standard ligatures go in the LIGA feature, optional ones often go in the DLIG feature. The coding logic is: If f + i, replace both with fi ligature.

  2. The other option is contextual variations. In this case, you don’t replace the entire search string, but just parts of it, based on the surrounding. For example: You could have a C without any swashes as default and then two variations with a swash to the right at the bottom and a swash to the right at the top. The replacement is then done only if there is enough room. If a y follows, you can’t use the bottom swash; if an h follows, you can’t use the upper swash. To achieve this, you need to create so-called classes of relevant characters, e.g. “has_ascender” and “has_descender”. Then you make the substitution in a feature like CALT or CLIG. The coding logic in this case is: If C + [has_descender], replace C with C with upper swash.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.