Typophile

Puzzling problem with CALT feature in VOLT

giasson

Hi,
I am currently building an arabic font with a number of contextual alternates lookups.
In some of the lookups, I use groups as substitution targets and/or context.

All my lookups and groups seem to follow the appropriate syntax; the font compiles just fine.
However the “substitution behaviour” of those lookups which use groups (instead of a list of individual substitutions) is completely erratic. Per ex, in a lookup where I have:

< Group1a > -> < Group1b > in the context of being followed by < Group99 >

in which the elements of Group1a are: A and B (in that order)
the elements of Group1b are: A.alt and B.alt (in that order)

We would normally expect A to be replaced with A.alt and B with B.alt

However it is not what is happening. Instead, A is replaced with B.alt and B is replaced with A.alt.
It is not simply an inversion [which itself would also be puzzling]; with larger groups, elements A, B, C, D are replaced randomly (ex: A by C.alt, B by A.alt, C by D.alt, D by B.alt)

The randomness does not come from the glyph order in the classes. The glyphs in each respective class are enumerated to match the position of the substitute glyph in the other class. In the vtl and vtg files:

DEF_GROUP “Group1a”
ENUM GLYPH “A” GLYPH “B” END_ENUM
END_GROUP
END

—

DEF_GROUP “Group1b”
ENUM GLYPH “A.alt” GLYPH “B.alt” END_ENUM
END_GROUP
END

—

DEF_LOOKUP “Calt01” PROCESS_BASE SKIP_MARKS DIRECTION RTL [#this is an arabic script font]
IN_CONTEXT
RIGHT GROUP “Group99”
END_CONTEXT
AS_SUBSTITUTION
SUB GROUP “Group1a”
WITH GROUP “Group1b”
END_SUB
END_SUBSTITUTION
END

——-

The random substitution happens for a given lookup even when I delete all the other substitution lookups to make sure there is no unforeseen “interference” or problem of substitution order/sequence.

Clearly if this is not working I must be doing something wrong, but I’ve checked again and again, notably by comparing with “Arabtype.volt.ttf”, and I can’t find where I’m erring.

An inelegant way around this would be of course to explicitely enumerate each ’glyph to glyph’ substitution individually (and it does work that way for the few lookups I’ve converted) but using groups *should* work and there are lookups which contain 30+ glyphs to substitute in the context of 6+ glyphs so I would not want to have to enumerate each combination individually.

Any help would be much appreciated! Thanks,
Patrick

The VOLT Release Notes (bottom of the page) say:

NOTE: Glyphs in groups are always ordered by their glyph IDs and not by the order implied from the way a group is described.

So what matters is not the order of glyph names in group definitions, but the order of glyphs in the font. The glyph order should be A B C ... and A.alt B.alt C.alt ...

Karsten

Yes, Karsten has it right: the GID orders of the two groups need to be cardinal. This limits the use of groups in substitution lookups. Generally, I recommend against the use of groups in this way anyway, since it doesn’t provide any visual feedback on the substitutions in the lookup.

D’oh!

Thank you very much Karsten and John for your help

Patrick

Captured from web.archive.org on 8 Dec 2008. view this capture