Contextual substitution help

Hi there,

the script face im currently creating has 4 lowercase s’. in my design the ‘v’ and ‘w’ are the only ones that do not connect smoothly, to try to get round this i have written - sub [v w] s’ by s.init; - this uses my s.init when next to the v to resolve the ugly entry stroke on the s.

my issue is that when a v is followed by an s and its the end of the word i need it to use my s.fina.alt, I’m unsure how to write this into the code.

  • im very new to opentype coding so apologies if this is obvious.

many thanks,

How about this:

lookup v_s {
ignore sub s' @someOtherLetter;
sub v s' by s.fina.alt;
} v_s;

It substitutes s with s.fina.alt if it follows v, except when s is followed by another letter class (you make this class. It’s just a list of all lowercase letters). And put this in the calt feature.

That is most likely a problem with the ordering of the substitutions.

The sub to s.fina.alt does not work because the normal s is already substituted to s.fina. So you need to add something like this:

sub [v w] s' by s.init;
sub [v w] s.fina' by s.fina.alt;

Many thanks both of you! Thats done the trick



Hi again, all was going great until i introduced stylistic sets. Im trying to create stylistic sets with letters that break the connections like this ‘r.ss03’ for example. Above is my current ss03 and calt codes. I cant quite see why it isn’t working?

You need to check the order of the features. If you move the ss03 feature to the top of the list, it should work.

Perfect, thank you Georg.