1 ;; KHMR-OTF.flt -- Font Layout Table for Khmer OpenType fonts
2 ;; Copyright (C) 2005, 2007 AIST (H15PRO112)
3 ;; See the end for copying conditions.
5 (font layouter khmr-otf nil
6 (font (nil nil unicode-bmp :otf=khmr=pres)))
10 ;;; For Khmer OpenType fonts to draw Khmer.
11 ;;; A Font is available from
12 ;;; <http://www.khmeros.info/drupal/?q=en/download/fonts>.
15 (0x1780 0x17FF ?E) ; E: else
17 (0x1780 0x17B3 ?C) ; C: consonant & independent vowel
19 (0x17B6 ?p) ; p: vowel sign (post)
20 (0x17B7 0x17BA ?a) ; a: vowel sign (above)
21 (0x17BB 0x17BD ?b) ; b: vowel sign (below)
22 (0x17BE ?A) ; A: vowel sign (two-part, above)
23 (0x17BF 0x17C0 ?P) ; P: vowel sign (two-part, post)
24 (0x17C1 0x17C3 ?m) ; m: vowel sign (pre)
26 (0x17C6 ?s) ; s: sign (above)
27 (0x17C7 0x17C8 ?S) ; S: sign (post)
28 (0x17C9 0x17CA ?c) ; c: consonant shifter
30 (0x17CC ?r) ; r: ROBAT
31 (0x17D2 ?H) ; H: COENG
34 (0x200C ?N) ; N: ZERO WIDTH NON-JOINER
35 (0x200D ?J) ; J: ZERO WIDTH JOINER
38 ;; Generic syllable pattern is as follows.
39 ;; [CR](r|N?c)?(HCr?)*(HR)?(HCr?)*[NJ]?(m|b|a|A|p|P)?s*S?(H[CR])?
42 ;; Move m to the beginning.
44 ;; Exchange the order of pP and s.
45 ;; Move HR before the base.
53 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?)(m)(s*S?(H[CR])?)"
54 < | (8 =) (4 = =) (1 = *) (5 =) (6 = *) (9 = *) | > )
56 ;; two-part above vowel sign
58 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?As*S?(H[CR])?)"
59 < | 0x17C1 (4 = =) (1 = *) (5 =) (6 = *) | > )
62 ;;1 2 3 4 5 67 8 9 10 11
63 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?)(p)(s*)(S?(H[CR])?)"
64 < | (4 = =) (1 = *) (5 =) (6 = *) (9 = *) (8 =) (10 = *) | > )
66 ;; two-part post vowel sign
67 ;;1 2 3 4 5 67 8 9 10 11
68 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?)(P)(s*)(S?(H[CR])?)"
69 < | 0x17C1 (4 = =) (1 = *) (5 =) (6 = *) (9 = *) (8 =) (10 = *) | > )
71 ;; other vowel signs or no vowel sign
73 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?[b|a]?s*S?(H[CR])?)"
74 < | (4 = =) (1 = *) (5 =) (6 = *) | > )
79 ;; Now a syllable looks like below.
80 ;; m?(HR)?[CR](r|N?c)?(HCr?)*[NJ]?(b|a|A)?s*(p|P)?S?(H[CR])?
83 ;; Set the form of consonant shifter.
88 ;; shifter + above vowel sign without ZWNJ
89 ;; Shifter take blwf. HR takes pref. HC's take blwf or pstf.
91 (" (m)?(HR)?([CR]c(HCr?)*(N|J)?(a|A))(s*S?)(H[CR])? "
95 (3 otf:khmr=blwf,abvf,pstf+)
97 (8 otf:khmr=blwf,pstf+)
100 ;; shifter + ZWNJ + above vowel sign, or, shifter without above vowel sign
101 ;; Shifter stays above. HR takes pref. HC's take blwf or pstf.
102 ;; 1 2 3 45 6 7 8 9 10 11
103 (" (m)?(HR)?([CR]N?c)((HCr?)*)([NJ]?[ba]?)(A)?(s*p?)(P)?(S)?(H[CR])? "
108 (4 otf:khmr=blwf,pstf+)
114 (11 otf:khmr=blwf,pstf+)
118 ;; 1 2 3 45 6 7 8 9 10 11
119 (" (m)?(HR)?([CR]r?)((HCr?)*)([NJ]?[ba]?)(A)?(s*p?)(P)?(S)?(H[CR])? "
124 (4 otf:khmr=blwf,pstf+)
130 (11 otf:khmr=blwf,pstf+)
136 ;; Now a syllable looks like below. ~ characters are OTF feature applied.
137 ;; m?(HR)?[CR](r|c)?(HCr?)*[NJ]?(b|a|A)?s*(p|P)?S?(H[CR])?
138 ;; ~~ ~~ ~ ~~~~ ~ ~ ~~~~~
141 ;; Concatenate adjacent Khmer syllables.
142 ;; Remove J. Retain N to prevent ligature.
153 ;; Apply other OTF features.
159 (1 otf:khmr=pres,blws,abvs,psts,clig))
165 ;; Remove N to clean up.
173 ;; Copyright (C) 2005, 2007
174 ;; National Institute of Advanced Industrial Science and Technology (AIST)
175 ;; Registration Number H15PRO112
177 ;; This file is part of the m17n database; a sub-part of the m17n
180 ;; The m17n library is free software; you can redistribute it and/or
181 ;; modify it under the terms of the GNU Lesser General Public License
182 ;; as published by the Free Software Foundation; either version 2.1 of
183 ;; the License, or (at your option) any later version.
185 ;; The m17n library is distributed in the hope that it will be useful,
186 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
187 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
188 ;; Lesser General Public License for more details.
190 ;; You should have received a copy of the GNU Lesser General Public
191 ;; License along with the m17n library; if not, write to the Free
192 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
193 ;; Boston, MA 02110-1301, USA.