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
Context Chain Substitution
-
- Posts: 39
- Joined: Wed Mar 30, 2005 4:49 pm
- Location: Nottingham, UK
- Contact:
Context Chain Substitution
Dr. Lesley Prince
_____________________
Everything that ever has meant anything has just as truly meant something else (Charles Fort)
_____________________
Everything that ever has meant anything has just as truly meant something else (Charles Fort)
-
- Moderator
- Posts: 11218
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: Context Chain Substitution
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;
}
-
- Posts: 39
- Joined: Wed Mar 30, 2005 4:49 pm
- Location: Nottingham, UK
- Contact:
Re: Context Chain Substitution
Thank you, Erwin
That is very helpful. I will try it out when I get back to 'The Beast' upstairs.
Best wishes
Les
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)
_____________________
Everything that ever has meant anything has just as truly meant something else (Charles Fort)
-
- Moderator
- Posts: 11218
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: Context Chain Substitution
Perfect. I look forward to your results.
Since the latest updates of FontCreator also support fea feature code, you can also use this.
Both will result in the exact same OpenType layout features, but FEA is a more common syntax, so it might help other people who are looking for a similar solution.
Since the latest updates of FontCreator also support fea feature code, you can also use this.
Code: Select all
languagesystem latn dflt;
@letters = [a-z A-Z];
lookup SingleSubstitution1 {
sub s by longs;
} SingleSubstitution1;
feature calt { # Contextual Alternates
sub @letters s' lookup SingleSubstitution1;
sub s' lookup SingleSubstitution1 @letters;
} calt;