Has anyone ever implemented GSUB type 8 lookups? Yannis Haralambous' book tells me that it was specifically designed for Urdu but I'm not sure I believe him, and I don't know of any Urdu fonts that use it. Does any font editing software even support it? (FontForge apparently
crashes when it sees one.) The only examples of it I've
found on github are AFDKO test files.
More to the point, can't reverse contextual substitutions always be rewritten in terms of forward contextual substitutions? What is the difference between
rsub foo wibble' by wibble.alt;
and
sub wibble' foo by wibble.alt;
Comments
No. One area where rsub would be particularly beneficial for latin fonts would be the handling of fractions. The method developed by Tai Leming which seems to have become common necessarily imposes an upper limit on the lengths of numerators.
http://opentypecookbook.com/common-techniques.html
If the contextual substitutions involved could be performed from right to left using rsub, this limit would go away (not to mention the fact that the code would be much shorter and simpler).
Unfortunately, rsub isn't widely supported so this solution wouldn't work in most applications which is why it isn't normally done.
(and indeed that seems to work nicely in my tests.)
Looks like it works on CoreText and Harfbuzz based applications, but not Adobe Illustrator (CS6 at least). I have not tested with Uniscribe.
Not Urdu per se, but nastaliq style Arabic as favoured for Urdu. Nastaliq is distinctive in that the form a letter takes is determined by the final letter in a connected group, i.e. you need to know what the final letter is in order to work backwards through the joining forms. This is because nastaliq employs variations in letter weight as well as shape in the pattern of letter groups. GSUB lookup type 8 was invented to provide a means to do contextual substitutions that would be processed backwards from the end of a glyph run.