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)?((HCr?)*[NJ]?)(m)(s*S?(H[CR])?)"
95 ;; two-part above vowel sign
97 ("([CR](r|N?c)?(HCr?)*)(HR)?((HCr?)*[NJ]?As*S?(H[CR])?)"
106 ;;1 2 3 4 56 7 8 9 10
107 ("([CR](r|N?c)?(HCr?)*)(HR)?((HCr?)*[NJ]?)(p)(s*)(S?(H[CR])?)"
117 ;; two-part post vowel sign
118 ;;1 2 3 4 56 7 8 9 10
119 ("([CR](r|N?c)?(HCr?)*)(HR)?((HCr?)*[NJ]?)(P)(s*)(S?(H[CR])?)"
130 ;; other vowel signs or no vowel sign
132 ("([CR](r|N?c)?(HCr?)*)(HR)?((HCr?)*[NJ]?[b|a]?s*S?(H[CR])?)"
142 ;; Now a syllable looks like below.
143 ;; m?(HR)?[CR](r|N?c)?(HCr?)*[NJ]?(b|a|A)?s*(p|P)?S?(H[CR])?
146 ;; Set the form of consonant shifter.
151 ;; shifter + above vowel sign without ZWNJ
152 ;; Shifter take blwf. HR takes pref. HC's take blwf or pstf.
154 (" (m)?(HR)?([CR]c(HCr?)*(N|J)?(a|A))(s*S?)(H[CR])? "
158 (3 otf:khmr=blwf,abvf,pstf+)
160 (8 otf:khmr=blwf,pstf+)
163 ;; shifter + ZWNJ + above vowel sign, or, shifter without above vowel sign
164 ;; Shifter stays above. HR takes pref. HC's take blwf or pstf.
165 ;; 1 2 3 45 6 7 8 9 10 11
166 (" (m)?(HR)?([CR]N?c)((HCr?)*)([NJ]?[ba]?)(A)?(s*p?)(P)?(S)?(H[CR])? "
171 (4 otf:khmr=blwf,pstf+)
177 (11 otf:khmr=blwf,pstf+)
181 ;; 1 2 3 45 6 7 8 9 10 11
182 (" (m)?(HR)?([CR]r?)((HCr?)*)([NJ]?[ba]?)(A)?(s*p?)(P)?(S)?(H[CR])? "
187 (4 otf:khmr=blwf,pstf+)
193 (11 otf:khmr=blwf,pstf+)
199 ;; Now a syllable looks like below. ~ characters are OTF feature applied.
200 ;; m?(HR)?[CR](r|c)?(HCr?)*[NJ]?(b|a|A)?s*(p|P)?S?(H[CR])?
201 ;; ~~ ~~ ~ ~~~~ ~ ~ ~~~~~
204 ;; Concatenate adjacent Khmer syllables.
205 ;; Remove J. Retain N to prevent ligature.
216 ;; Apply other OTF features.
222 (1 otf:khmr=pres,blws,abvs,psts,clig))
228 ;; Remove N to clean up.