Hi,
I have designed fonts before. Persian fonts. But I had never changed too much the OpenType features except the ligatures and intial, medial,... and diacritics and stuff like that.
But now I'm designing a Persian font with detached separated glyphs (like a Latin one).
And I have decided to do a {salt}. But it is a little complicated and I only do these things with the Open Type Designer, so maybe it is my lack of scripting capabilities.
It goes like this:
Substitute Kaf (only inital and medial) with a glyph I added myself to the Persian standard glyphs named _longKaf if all the next glyphs after Kaf are some glyphs gathered in a Class for example @NotDotAbove. Also do all of these just when users set the text to {salt}.
So I want to know which kind of substitution works better here and how? I did single sub, it worked but does the sub all the time.
Any help?
Best way to do this substitution
-
- Top Typographer
- Posts: 9874
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: Best way to do this substitution
I think what you need is a contextual substitution (calt)
Re: Best way to do this substitution
Thanks.
I did that too, but I can't make that to ignore some glyphs. It would apply the substitution at all times.
Should I use ChainingContext?
I did that too, but I can't make that to ignore some glyphs. It would apply the substitution at all times.
Should I use ChainingContext?
-
- Top Typographer
- Posts: 9874
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: Best way to do this substitution
I have only ever used a chaining context for Ordinals.
I think what you need is a Reverse Chaining Context
I think what you need is a Reverse Chaining Context
Re: Best way to do this substitution
Could you please tell me how to replace 2 glyphs with 1 new glyph but only when:
1- Certain Class is in front of the 2 glyphs.
2- Text is set on a salt or calt.
And also do this with reverse chaining context?
I really don't know!
1- Certain Class is in front of the 2 glyphs.
2- Text is set on a salt or calt.
And also do this with reverse chaining context?
I really don't know!
-
- Moderator
- Posts: 11108
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: Best way to do this substitution
Here is some OpenType layout feature code that will replace "12" with "3" if it is typed after a capital letter:Siavash wrote:Could you please tell me how to replace 2 glyphs with 1 new glyph but only when:
1- Certain Class is in front of the 2 glyphs.
2- Text is set on a salt or calt.
Code: Select all
script latn {
feature ContextualAlternates1;
feature StylisticAlternates1;
}
class @Uppercase [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z];
feature ContextualAlternates1 calt {
lookup ChainingContext1;
}
feature StylisticAlternates1 salt {
lookup ChainingContext1;
}
lookup ChainingContext1 {
context (@Uppercase) one two;
sub 0 Ligature1;
}
lookup Ligature1 {
sub one two -> three;
}
The above sample should provide enough information for you to get started.Siavash wrote:And also do this with reverse chaining context?
I really don't know!