Coding - Preventing "Return" from resetting contextual alternate sequence

Is there a way to incorporate “enter”/“return” into the sequence when dealing with contextual alternates? I’ve gotten “space” to work, but can’t seem to figure out how to get it for hard or soft returns to work as well.

No. OpenType features work with glyphs. And for a new line, text engines do not use glyphs, so you are out of luck in this case. Sorry.

I figured that was the case but thought it was worth asking. Thanks!

Any chance the answer to this question has changed in the six years since it was asked?

It depends on the app that implements it. TextEdit for instance does not stop at line breaks. But there is nothing you can do from within the font to force other apps to act like TextEdit.

The way opentype works is that the text is divided in ‘runs’. Breaks happen on script changes but also on line breaks. So there is no chance to get context spanning multiple lines.
TextEdit is wrong regarding the OpenType spec. It might have to do with the internal handling that MacOS is translating the OpenType substitutions into AAT. And AAT doesn’t do the breakup in text runs.

1 Like