I'm training to work with an opentype designer.
The form used is "chained context substitution". Various conditions apply. Each condition is created in one rule. The rules are arranged in four subtables. The same effect is obtained by creating four rules in one subtable. Why is this happening? The glyph substitution effect is obtained, but I can not understand the intended purpose of the subtables, rules.
How to interact with multiple items in any of the columns?
How to apply conditions in the "includes" tab?
What does this option mean?
I don't speak English. To understand the above, a monosyllabic text is written. Sorry.
Subtables. Rules. Working with "chained context substitution"
-
- Posts: 14
- Joined: Wed Jul 07, 2021 3:39 pm
-
- Moderator
- Posts: 11160
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: Subtables. Rules. Working with "chained context substitution"
They are basically the same, but the way they are stored inside the font binary is different.Torsten Ulv wrote: ↑Sat Apr 09, 2022 3:18 pm I'm training to work with an opentype designer.
The form used is "chained context substitution". Various conditions apply. Each condition is created in one rule. The rules are arranged in four subtables. The same effect is obtained by creating four rules in one subtable. Why is this happening? The glyph substitution effect is obtained, but I can not understand the intended purpose of the subtables, rules.
subtable and rules.
That is something very special which related to class0. It is hardly used.
With both chained context positioning and chained context substitution you can also make use of a special class known as class0. This class contains all glyphs except the ones used within the context. For example, if a font contains only these characters: a b c d e, then if Input uses a and d, class0 contains b c and e. The classes within the Includes section will all be treated as being not part of class0. If your rules do not make use of class0, then you can leave the Includes fields empty.
-
- Posts: 14
- Joined: Wed Jul 07, 2021 3:39 pm
Re: Subtables. Rules. Working with "chained context substitution"
However, I'm interested in trying it out.That is something very special which related to class0. It is hardly used.
Created a simple design and nothing more. In the Lookups added a single substitution of glyphs. Glyphs grouped into three classes. Where:
@0 - digits
@A - all uppercase
@a - all lowercase If you change the Input field in the Includes section by inserting classes one by one, then the effect of excluding glyphs from a particular class is obtained. It looks like this: I can't figure out how the Backtrack and Lookahead fields in the Includes section will work. Please, tell me.
-
- Moderator
- Posts: 11160
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: Subtables. Rules. Working with "chained context substitution"
Try this feature code. It is important to know it is not fea code but our own OTLFD syntax, as fea does not support this advanced stuff.
Also note, the "include input @three;" is not actually used in this example and can be left out.
You can test it in Word and in Edge, but somehow Firefox seems to have an issue with it. It might be a harfbuzz bug.
Also note, the "include input @three;" is not actually used in this example and can be left out.
You can test it in Word and in Edge, but somehow Firefox seems to have an issue with it. It might be a harfbuzz bug.
Code: Select all
script DFLT {
feature RequiredLigatures;
}
class @one [one];
class @three [three];
class @two_three [two three];
class @digits [zero-nine];
feature RequiredLigatures rlig {
lookup ChainingContextClass0;
}
lookup ChainingContextClass0 {
include backtrack @one;
include input @three;
context (@class0 @two_three) @digits;
sub 0 digittonumber;
}
lookup digittonumber {
sub zero -> numbersign;
sub one -> numbersign;
sub two -> numbersign;
sub three -> numbersign;
}