Hi all,
Now there is no GPOS lookup called "contextual mark positioning", but that's an accurate description of the scenario I'm about to describe. Consider the following (using Latin as a model, though the context I'm using this is not Latin):
Consider a unicode point UniChar decomposed into a base glyph Base1 and a mark PrimaryMark1. So
UniChar => Base1 + PrimaryMark1
For example, the character atilda can be decomposed into an "a" and a "tilda".
The feature "ccmp" and a single lookup takes care of this, of course.
Now I want to add a secondary mark SecondaryMark1 to the base, say, a macron. Note that I am adding SecondaryMark1 to the base glyph, NOT to PrimaryMark1.
The feature "mark" and a single lookup also takes care of this.
I apply this to lots of base glyphs and it works fine, but...
For the particular case of Base1, when I apply SecondaryMark1 to Base1, I need to offset the anchor coordinates of PrimaryMark1 for more aesthetic positioning. I cannot use "mkmk" because the relation between PrimaryMark1 and SecondaryMark1 is not constant from base glyph to base glyph.
So I need a contextual positioning definition that says, if SecondaryMark1 is applied to Base1, offset PrimaryMark1 by (x1,y1).
Let's express this scenario in feature-file syntax:
# GSUB
# Base1.comp is the unicode point in the font
lookup compose_primarymarks {
lookupflag IgnoreMarks;
sub Base1.comp by Base1 PrimaryMark1;
} compose_primarymarks;
feature ccmp {
lookup compose_primarymarks;
} ccmp;
# GPOS
lookup primarymarks {
mark PrimaryMark1 ;
pos Base1 mark [PrimaryMark1 ];
} primarymarks;
lookup secondarymarks {
mark SecondaryMark1 ;
pos Base1 mark [SecondaryMark1 ];
} secondarymarks;
Now I need a rule such that, if Base1 is marked by a SecondaryMark1, then the anchor coordinates for Base1 in the primarymarks lookup must be offset by (x1,y1).
Opentype does have a Contextual Chain Positioning lookup but it is very obscure and I'm not sure it is designed or capable of dealing with this kind of situation (which deals with different anchor classes). I've spent many hours on this but cannot find a solution.
I could add alternate glyphs and use more GSUB lookups but that defeats the entire purpose and will lead to the glyph mess I wanted to avoid in the first place. The point is to be able to control, for a given character or character string, the interrelation of base glyph, primary mark, and secondary mark.
Put another way: If the string
Base1 PrimaryMark1 [SecondaryMark2 SecondaryMark3 SecondaryMark4 SecondaryMark5 SecondaryMark6]
is encountered, the primarymarks and secondarymarks lookups are invoked. But if
Base1 PrimaryMark1 [SecondaryMark1]
is encountered, then the anchor coordinates of Base1 in primarymarks are offset by (x1,y1).
There is a feature-file syntax for contextual chaining positioning, but this aspect of the syntax is a bit obscure for me:
http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.htm...
NOTE: I am NOT worried at this point about whether or not Uniscribe or some other renderer supports this. I am only concerned about representing the above scenario in valid, opentype form. That is, How do I represent the above scenario in an OpenType font?
I hope the above is clear. I cannot use mkmk, and I want to avoid a multiplication of glyph alternates.
Thank you in advance
Best wishes
Idris
