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
- 46 Introductions
- 3.9K Typeface Design
- 485 Type Design Critiques
- 560 Type Design Software
- 1.1K Type Design Technique & Theory
- 654 Type Business
- 853 Font Technology
- 29 Punchcutting
- 519 Typography
- 119 Type Education
- 323 Type History
- 77 Type Resources
- 112 Lettering and Calligraphy
- 33 Lettering Critiques
- 79 Lettering Technique & Theory
- 550 Announcements
- 91 Events
- 114 Job Postings
- 170 Type Releases
- 174 Miscellaneous News
- 276 About TypeDrawers
- 54 TypeDrawers Announcements
- 120 Suggestions and Bug Reports
