I am currently developing an OpenType font for Khmer and I would like to add AAT features to it. I already got used a bit to the AAT feature coding style, but I still have some problems especially with the insertion feature. I just try to explain what I would like my font to do without posting any code. I hope that is OK …
For a Khmer font to work properly, glyph rearrangement is needed, since some vowel signs are placed before or even around a consonant. This is the case for E, AE, AI (written before a consonant), and for OO, AU, OE, YE and IE (they all have a vowel-e element written before the consonant and another element written above or behind the consonant).
Also, Khmer uses so-called subscript letters. These are consonant letters that are attached to the main consonant letter and build a consonant cluster.Typically they are written underneath or next to the main consonant letters. There is one exception for RO, whose subscript form is written before the main consonant.
If you have the syllable KROO, it would consist of the letters KA + Subscript RO + Vowel OO but written like E (first part of Vowel OO) + Subscript RO + KA + AA (last part of Vowel OO). Subscript letters are typed in with a combination of an invisible subscript mark followed by the consonant. So, syllable KROO would be typed in as: KA + Coeng (the subscript mark) + RO + OO.
This structure is quite complex, what is why implementing AAT features is quite a challenge … at least for me!
So, what we need for a syllable structure like the one above, is the following:
We want to go from:
KA + Coeng + RO + OO
E + Subscript RO + KAA (with E and AA being the surrounding elements that make together the Vowel O and KA + AA forming the ligature KAA.
Insert E in front of OO and than substitute OO with AA
(Result: KA + Coeng + RO + E + AA)
Substitute Coeng + Consonant with Subscript Consonant
(Result: KA + Subscript RO + E + AA)
Third step (I added this step, because I didn’t get the double rearrangement right)
Substitute Subscript RO + E to a special ligature (E_RO)
(Result: KA + E_RO + AA)
Make a rearrangement of every E, Subscript Ro and the special ligatures E_RO
(Result: E_RO + KA + AA)
Make final ligatures of consonants and AA
(Result: E_RO + KAA)
So far so good. But somehow it doesn’t work the way it should. There seems to be a problem with the insertion feature, especially with the kashida-like option. For some combinations it works only if I make the insertion kashida-like, for other combinations it works only if it is not kashida-like. Problems are invisible characters, character placement way above the baseline (I really don’t get this one) or even crashes.
So, what is wrong with my approach? I was so proud of finally having a working solution after I neary despaired with the double replacement of E and Subscript RO, but somehow it doesn’t work either! Maybe I should do it in another way? I also thought of inserting E, RO and E_RO directly in front of the first main consonant … but this didn’t work for another reason. It would be great if I could use this approach!
I guess it has to to with the kashida-likeness, so if someone could tell me what exactly is meant by “Kashida like” that would be awesome!
Thank you so much!
Greetings from Germany
OK, I solved it!
Apple does it the tricky way: They just don’t use the special functions of the insertion feature. I tried to insert an vowel E before the circumscript vowels OO, AU, OE, YA and IE. Apple just inserts the backmost part behind the circumscript vowels and substitutes the original glyph by the vowel E glyph. Than they first rearrange the vowel E to the front, followed by the subscript RO.
Wow! I can’t really believe that it finally works! I worked so long to solve this problem! Oh man! Thanks Tom for your support!