What code should I add to make this work automatically in Illustrator? It’s working fine in Glyphs preview but once exported and tested in Illustrator the positional alts are not automatically changing.
Can you show your feature code?
The code was generated automatically after adding four-letter codes.
The positional features work (mostly) only for Arabic fonts. So you need to write some contextual features. https://glyphsapp.com/tutorials/features-part-4-positional-alternates Scroll down a bit for Positional Forms as Contextual Alternates
Thanks! Is there a way that I can make Contextual Alternates automatic in Illustrator without having ticking the Contextual Alternates button in the OpenType panel?
Contextual Alternates is on by default in a new installation of Adobe CC, that is until the user disables it when there are no document windows open (which is how you change defaults in most Adobe apps).
You could do a hack as solution and repeat the lookup calls (just
lookup LOOKUPNAME; without the curly braces) in a feature that cannot be disabled, like
rlig, but no guarantee that it doesn’t mess up in a different Composer for example.
So the most sound way of doing it is opening illustrator and changing the contextual alternates setting while no doc is open.