feature definitions not working together

daverowland's picture

In the calt feature of my font, I am trying to get |t i| to substitute for |t dotlessi| so that the crossbar of the t acts as the tittle of the i.
This is easy enough and works fine:

sub @tbeforei i' by dotlessi;
(it is a class because it contains ligatures ending in t and alternate forms of t)

My problem arises with the next lookup in calt, which is supposed to substitute glyphs at the ends of words with their ending alternates:

ignore sub @tobeendform' @letter;
sub @tobeendform' by @endform;

so it should change the glyph in the tobeendform class to its corresponding glyph in the endform class. This works on all letters except i when following t. I have both i and dotlessi in the tobeendform class and i.end and dotlessi.end in the endform class.

I know it's unlikely that words ending in ti will crop up that often, but I'm asking because this problem has wider implications. I've tried swapping the two lookups round and even duplicating the lookups so that if one happens first, the other will happen after nomatter what, but that doesn't work. I don't understand why the first lookup has changed the i to dotlessi, but then the second lookup can't change this dotlessi to dotlessi.end

If anyone can shed any light on this I'd be very grateful!

daverowland's picture

I've found the problem - I hadn't separated the lookups properly like this:

lookup endforms {
ignore sub @tobeendform' @letter;
sub @tobeendform' by @endform;
}endforms;

so the ignore sub parts were covering everything in the calt feature, not just the following lines of code.

Duh!

Syndicate content Syndicate content