Issue with contextual alternates


I'm currently working on a type project that requires some opentype knowledge that I lack.

I would like to create a font that use contextual alternates to swap glyphs based on there occurence in the text.

Therefore the font would have to "count" the number of time a letter appear in the text and switch it if need be.
For exemple I'd like to be able to set an opentype feature that would swap the 25th "a" and 3rd "b" of the text with an alternative "a'' and "b". I'd like the font to be able to evolve depending on the content used and select additional letters based on the number of time that letter was used.

Is there a way to do something like that ?

I'm fairly new to font creation and open type features but I have some basic knowledge of Glyphs and Robotfont.

Any help would be greatly appreciated ;)


ralf h.'s picture

Nope, OpenType can’t count.
I guess you need to dig into JavaScript — or whatever script language your text/layout application offers you — to achieve this.

hrant's picture

I'm curious: why would you do such swapping?


Thomas Phinney's picture

Actually, OpenType can count, but it involves excessive amounts of code, and has limitations....

Syndicate content Syndicate content