EXAMPLE: One-to-many in context

70 views
Skip to first unread message

Miguel Sousa

unread,
Nov 23, 2013, 6:29:58 PM11/23/13
to uafd...@googlegroups.com
If you need to do a one-to-many substitution in context (e.g. inserting a kashida in Arabic, extending the headline in Devanagari, or doing something else in Latin), the code below will not work. The error will be 'Unsupported contextual GSUB replacement sequence'.

feature xxxx {
sub CONTEXTBEFORE inputGlyph' CONTEXTAFTER by outputGlyph1 outputGlyph2;
} xxxx;


The solution is to do the one-to-many substitution in a standalone lookup, and then reference that lookup in the context, like so:

lookup ONE2MANY {
sub a by asterisk a asterisk;
sub b by asterisk b asterisk;
} ONE2MANY;

feature xxxx {
sub CONTEXTBEFORE [a b]' lookup ONE2MANY CONTEXTAFTER;
} xxxx;

Note: CONTEXTBEFORE and CONTEXTAFTER can be single glyphs (or glyph classes) or sequences of glyphs (or glyph classes); also, one of them can be omitted if the context is only needed on one side of the input glyphs.

If you test with InDesign, make sure you're using the World-Ready composer. (Since CS6 the WRC option is exposed in the UI.)

M.

Reply all
Reply to author
Forward
0 new messages