Hello.
I’m working on a font that has a lot of contextual alternates. The substitutions depend on which letters sit on left or right side of a letter because some of the letters should connect to each other. When a letter connects to another letter the serif is adjusted. Therefor i name the glyphs in such a way:
N (for the default N)
N.left (for when the N has an adjusted serif on the left side)
N.right (for when the N has an adjusted serif on the right side)
N.both (for when the N has an adjusted serif on both sides)
So if i for example want to write UN:
U needs to be subbed by U.right
N needs to be subbed by N.left
The code i wrote as a calt feature is:
sub U’ N by U.right;
sub U.right N’ by N.left;
Likewise if i want to write NE:
N needs to be replaced by N.right
E needs to be replaced by E.left
My calt feature code for this is:
sub N’ E by N.right;
sub N.right E’ by E.left;
So far so good, these are working, but the problem accurs if i then want to write UNE.
I now need the N to have the adjusted serif on both sides so i want to sub it with N.both.
I try the code:
sub N.left’ E by N.both;
But somehow this doens’t work. The N.left is not reacting.
So this is the full code so far:
sub U’ N by U.right;
sub U.right N’ by N.left;
sub N’ E by N.right;
sub N.right E’ by E.left;
sub N.left’ E by N.both;
In general i’m also unsure if this approach is the right way to go, because there will be a lot of alternates and i will end up with a lot of code. If someone can point me to the right resource for me to look into in i would be grateful.