Issue with contextual alternates

Primary tabs

4 posts / 0 new
Last post
charles connoué's picture
Joined: 17 Mar 2013 - 11:02am
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 ;)


Typography.Guru's picture
Joined: 8 May 2003 - 2:39pm

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 H Papazian's picture
Joined: 3 May 2000 - 11:00am

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


Thomas Phinney's picture
Joined: 3 Sep 2002 - 11:00am

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