RTL contextual alternates in Google Chrome (webfont)

Hi again,

So, the second problem I’m having is contextual substitution (and kerning, for that matter) in RTL orientation. My font works as follows: you enter the code for a particular symbol, let’s say N14, and through a custom font feature that essentially works like a ligature, the proper symbol is shown:

sub [n N] one four by u131FC;

I decided to go this route so that anyone typing either online or in DTP software, can work with the codes they’re used to. The font takes care of the rest.

So anyway, the webfont works perfectly in Safari:

The text entered in the white field is mirrored using JavaScript in the text above. In Chrome, the mirroring itself works fine:

But, when using my webfont in chrome, the contextual alternates algorithm is still reading LTR, so it’s taking N14G1 (which in RTL looks like 1G41N) and substituting G41 instead.

In that last screenshot, I did a test showing that if I enter 41N I get the symbol N14.

Am I missing something? Do I need to set up the language settings differently in the font? Does anyone know why this is working in Safari, but not in Chrome?

Any help would be greatly appreciated!!!

Thanks again,


If that is the case, then it is a bug in Chrome. The order of the character stream and the glyphs must be treated logically, not spatially.

The mirroring seems to be applied before OpenType layout in Chrome. I don’t think you can something about this. You can try to improve javascript mirroring to keep the syllable sequence intact. So instead of N14-G1 > 1G-41N you do N14-G1 > G1-N14.

Thanks, I’ll look into it.

Incidentally, the same thing happens without the mirroring, if I style a block of text straight-out.

I’ll report the problem to Google.