Context Chain Substitution

Before asking a question on FontCreator look here for possible solutions and tutorials. Please do not post support requests here.
Post Reply
Lesley Prince
Posts: 39
Joined: Wed Mar 30, 2005 4:49 pm
Location: Nottingham, UK
Contact:

Context Chain Substitution

Post by Lesley Prince » Fri May 22, 2020 5:09 pm

Hello
I am having trouble with Chained Context Substitution. What I want to achieve is to substitute a normal 's' for the 'long s' as used in C17 and C18 writing. So far I have managed to use ligature substitution, but the long s requires some sensitivity to context. I have set up a substitution table as an alternate and I have managed to get into the context dialogue but what I can't do, or don't know how to do, is specify the context, i.e. that when 's' is flanked by other letters, it becomes the long s. How do I specify that all (lower case) letters are included in the flanking criteria? I have read the tutorials and other posts, but I am none the wiser.

Yours in anticipation,
Puzzled of Nottingham

Les Prince :roll:
Dr. Lesley Prince

_____________________

Everything that ever has meant anything has just as truly meant something else (Charles Fort)

Erwin Denissen
Moderator
Moderator
Posts: 8620
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: Context Chain Substitution

Post by Erwin Denissen » Fri May 22, 2020 7:11 pm

I hope this OpenType feature code helps:

Code: Select all

script latn {
  feature ContextualAlternates;
}

class @letters [a-z A-Z];

feature ContextualAlternates calt {
  lookup ChainingContext1;
}

lookup ChainingContext1 {
  context (@letters) s;
  sub 0 SingleSubstitution1;
  context s (@letters);
  sub 0 SingleSubstitution1;
}

lookup SingleSubstitution1 {
  sub s -> longs;
}
Erwin Denissen
High-Logic
Proven Font Technology

Lesley Prince
Posts: 39
Joined: Wed Mar 30, 2005 4:49 pm
Location: Nottingham, UK
Contact:

Re: Context Chain Substitution

Post by Lesley Prince » Wed Jun 03, 2020 12:06 pm

Thank you, Erwin
That is very helpful. I will try it out when I get back to 'The Beast' upstairs.
Best wishes
Les
Dr. Lesley Prince

_____________________

Everything that ever has meant anything has just as truly meant something else (Charles Fort)

Post Reply