Classname/Shortname for a sequence of glyphs
Saurabh Sharma
Posts: 23
I would like to ask if there is any way to declare a class name (or more appropriately, a short name) for an exact sequence of glyphs?
For example, I want to do the following substitution:
lookup example {
sub a b c d e f m' by g;
} example;
I would be using the same sequence {a b c d e f} many times in different lookups. In order to keep it short and avoid redundancy, is it possible to declare a class name for the sequence as:
my_sequence = {a b c d e f };
and then, the lookup as:
lookup example {
sub my_sequence m' by g;
} example;
So whenever this exact sequence occurs, the "m" followed by it will be replaced by a "g".
I am also interested in combining two sequences like the following:
sequence1 = {a b c d e f };
sequence2 = {g h i j k l m };
sequence3 = {sequence1 sequence2 };
Using Glyph classes doesn't solve the purpose here as it matches individual items against a rule, and not the entire sequence. Please advise if anyone knows of a workaround or a feature for this scenario.
Tagged:
0
Comments
-
No, this is not possible.
1 -
Thank you for confirming @Erwin Denissen . I almost came to that conclusion when I couldn't find a reference on Microsoft's OpenType overview and some other online resources. May be this is not in the specification due to a very limited use-case.0
-
I do not know what you want to accomplish, but this example uses two lookups. In fact this is how it also ends up in the font binary, even if you use a single contextual lookup in fea.languagesystem latn dflt;
@mnop = [m-p];
@ghij = [g-j];
lookup SingleSubstitution1 {
sub @mnop by @ghij;
} SingleSubstitution1;
feature rlig {
sub a b c d e f @mnop' lookup SingleSubstitution1;
} rlig;Here is how it works in FontCreator:
2 -
Thanks again, Erwin. My use case is with a Devanagari font project in which I am trying to combine some custom shapes (horizontal bars) to form a single entity. I will try with a glyph range with decimal digits in a contiguous run. May be that works. I am not sure if a glyph range will do individual item substitution or an entire range substitution, but worth giving a try.
0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 803 Font Technology
- 1K Technique and Theory
- 622 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 485 Typography
- 303 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 270 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports