1 ;; KHMR-OTF.flt -- Font Layout Table for Khmer OpenType fonts
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H15PRO112
6 ;; This file is part of the m17n database; a sub-part of the m17n
9 ;; The m17n library is free software; you can redistribute it and/or
10 ;; modify it under the terms of the GNU Lesser General Public License
11 ;; as published by the Free Software Foundation; either version 2.1 of
12 ;; the License, or (at your option) any later version.
14 ;; The m17n library is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;; Lesser General Public License for more details.
19 ;; You should have received a copy of the GNU Lesser General Public
20 ;; License along with the m17n library; if not, write to the Free
21 ;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26 ;;; For Khmer OpenType fonts to draw Khmer.
27 ;;; A Font is available from
28 ;;; <http://www.khmeros.info/drupal/?q=en/download/fonts>.
32 ;; C : consonant & independent vowel
35 ;; m : vowel sign (pre)
36 ;; b : vowel sign (below)
37 ;; a : vowel sign (above)
38 ;; A : vowel sign (two-part, above)
39 ;; p : vowel sign (post)
40 ;; P : vowel sign (two-part, post)
43 ;; c : consonant shifter
45 ;; N : ZERO WIDTH NON-JOINER
46 ;; J : ZERO WIDTH JOINER
71 ;; Generic syllable pattern is as follows.
72 ;; [CR](r|N?c)?(HCr?)*(HR)?(HCr?)*[NJ]?(m|b|a|A|p|P)?s*S?(H[CR])?
75 ;; Move m to the beginning.
77 ;; Exchange the order of pP and s.
78 ;; Move HR before the base.
86 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?)(m)(s*S?(H[CR])?)"
96 ;; two-part above vowel sign
98 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?As*S?(H[CR])?)"
108 ;;1 2 3 4 5 67 8 9 10 11
109 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?)(p)(s*)(S?(H[CR])?)"
120 ;; two-part post vowel sign
121 ;;1 2 3 4 5 67 8 9 10 11
122 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?)(P)(s*)(S?(H[CR])?)"
134 ;; other vowel signs or no vowel sign
136 ("([CR](r|N?c)?(HCr?)*)(HR(r)?)?((HCr?)*[NJ]?[b|a]?s*S?(H[CR])?)"
147 ;; Now a syllable looks like below.
148 ;; m?(HR)?[CR](r|N?c)?(HCr?)*[NJ]?(b|a|A)?s*(p|P)?S?(H[CR])?
151 ;; Set the form of consonant shifter.
156 ;; shifter + above vowel sign without ZWNJ
157 ;; Shifter take blwf. HR takes pref. HC's take blwf or pstf.
159 (" (m)?(HR)?([CR]c(HCr?)*(N|J)?(a|A))(s*S?)(H[CR])? "
163 (3 otf:khmr=blwf,abvf,pstf+)
165 (8 otf:khmr=blwf,pstf+)
168 ;; shifter + ZWNJ + above vowel sign, or, shifter without above vowel sign
169 ;; Shifter stays above. HR takes pref. HC's take blwf or pstf.
170 ;; 1 2 3 45 6 7 8 9 10 11
171 (" (m)?(HR)?([CR]N?c)((HCr?)*)([NJ]?[ba]?)(A)?(s*p?)(P)?(S)?(H[CR])? "
176 (4 otf:khmr=blwf,pstf+)
182 (11 otf:khmr=blwf,pstf+)
186 ;; 1 2 3 45 6 7 8 9 10 11
187 (" (m)?(HR)?([CR]r?)((HCr?)*)([NJ]?[ba]?)(A)?(s*p?)(P)?(S)?(H[CR])? "
192 (4 otf:khmr=blwf,pstf+)
198 (11 otf:khmr=blwf,pstf+)
204 ;; Now a syllable looks like below. ~ characters are OTF feature applied.
205 ;; m?(HR)?[CR](r|c)?(HCr?)*[NJ]?(b|a|A)?s*(p|P)?S?(H[CR])?
206 ;; ~~ ~~ ~ ~~~~ ~ ~ ~~~~~
209 ;; Concatenate adjacent Khmer syllables.
210 ;; Remove J. Retain N to prevent ligature.
221 ;; Apply other OTF features.
227 (1 otf:khmr=pres,blws,abvs,psts,clig))
233 ;; Remove N to clean up.