The most complicated part was to embed typographic features to the font. Since Khmer is a writing system with a lot of context sensitive shape-substitutions and rearrangements, there is a lot of work to do, not only to embed all the features that are necessary but also to arrange them in a correct order.
Since Apple’s MacOS doesn’t support OpenType Features completely (especially for the highly complex writing systems of South-East Asia there is little to no support), I had to rely on Apple’s own AAT features. It really took some time to figure out how the AAT engine works. This is especially true for the rearrangement and insertion features that I really had to rack the brains over!
Below is a chart of the most important substitions and rearrangements. There are some example letter clusters shown (they are just representative and have no sense at all) with the first line being the arrangement as typed in and the last line the final rendering. For better illustration I added a dotted circle for diacritical characters and dependend vowel or consonant signs, except for the last line.