1 ;; MLYM-OTF.flt -- Font Layout Table for Malayalam OpenType font
2 ;; Copyright (C) 2003, 2004, 2005, 2007, 2008 AIST (H15PRO112)
3 ;; See the end for copying conditions.
5 (font layouter mlym-otf nil
6 (font (nil nil unicode-bmp :otf=mlym=akhn)))
10 ;;; For Malayalam OpenType fonts to draw the reformed Malayalam script.
13 ;; C: consonant (except for R, B, and P)
15 ;; B: consonant (below)
16 ;; P: consonant (post)
18 ;; m: vowel sign (pre)
19 ;; b: vowel sign (below)
20 ;; p: vowel sign (post)
21 ;; A: vowel modifier (post)
22 ;; V: independent vowel
23 ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
24 ;; J: ZWJ (ZERO WIDTH JOINER)
27 (0x0D00 0x0D7F ?X) ; generic
28 (0x0D00 ?Z) ; internal use
29 (0x0D02 0x0D03 ?A) ; SIGN ANUSVARA .. VISARGA
30 (0x0D05 0x0D14 ?V) ; LETTER A .. AU
31 (0x0D15 0x0D39 ?C) ; LETTER KA .. HA
32 (0x0D2F ?P) ; LETTER YA
33 (0x0D30 ?R) ; LETTER RA
34 (0x0D32 ?B) ; LETTER LA
35 (0x0D35 ?P) ; LETTER VA
36 (0x0D3E 0x0D44 ?p) ; VOWEL SIGN AA .. VOCALIC RR
37 (0x0D46 0x0D48 ?m) ; VOWEL SIGN E .. AI
38 (0x0D4D ?H) ; SIGN VIRAMA
39 (0x0D57 ?p) ; AU LENGTH MARK
40 (0x0D60 0x0D61 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
41 (0x0D62 0x0D63 ?b) ; VOWEL SIGN VOCALIC L .. LL
42 (0x0D7A 0x0D7F ?C) ; LETTER CHILLU NN .. K
43 (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
48 ;; Decompose two-part vowels.
61 ;; Syllable identification and reordering.
62 ;; Put the mark 0x0D00 before the first pre-base consonant and after
63 ;; the base consonant.
67 ;; A syllable with a left vowel sign.
69 ("([CRBP](H[CRBP])*)(m)(p?A?)"
70 < | (3 =) (1 get-rh) 0x0D00 (1 move-h) (4 = *) | >)
72 ;; A syllable with a right vowel sign, a below vowel sign
73 ;; and/or a vowel modifier.
75 ("([CRBP](H[CRBP])*)(bA?|pA?|A)"
76 < | (1 get-rh) 0x0D00 (1 move-h) (3 = *) | >)
78 ;; Explicit Halant / forced chillu form is cut off from the preceders.
79 ("(([CRBP]H)*)([CRBP]H[NJ])"
80 (1 cut-off) (3 < | = * | >))
82 ;; A syllable with no vowel signs/modifiers.
83 ("([CRBP](H[CRBP])*H?)"
84 < | (1 get-rh) 0x0D00 (1 move-h) | >)
86 ;; Starting with an independent vowel.
93 ;; Extract RH that will be moved to the left.
99 ;; Move the halant after the base consonant to the end.
100 ;; Fill the resulting gap with 0x0D00.
101 ;; Remove final RH if any.
104 ;; There is a C and the syllable ends with an R. Remove final RH.
105 ("([CRBPH]*C)H([RBPH]*)R$"
106 (1 = *) 0x0D00 (2 = *))
108 ;; The syllable ends other than R. Move H.
109 ("([CRBPH]*C)(H)([RBPH]+)$"
110 (1 = *) 0x0D00 (3 = *) (2 =))
112 ;; No C and end with R. The first consonant will be the base. Remove RH.
113 ("([RBP])H([RBPH]*)R$"
114 (1 =) 0x0D00 (2 = *))
116 ;; No C and not end with R. Move H.
117 ("([RBP])(H)([RBPH]+)$"
118 (1 =) 0x0D00 (3 = *) (2 =))
120 ;; Otherwise, no need to move H.
124 ;; If there are some letters make them a separate syllable.
131 ;; Apply GSUB features.
132 ;; According to Microsoft Typography
133 ;; <http://www.microsoft.com/typography/otfntdev/malayot/features.htm>
134 ;; 'chillu' are generated with the 'haln' feature. However, some
135 ;; fonts generate them with 'half'.
139 ;; Ordinary syllable. We must avoid applying 'blwf' and 'pstf' to
140 ;; the first consonant. Also 'haln' and 'half' must be avoided
141 ;; because chillu does not appear at the beginning of a word. Thus
142 ;; we apply only 'akhn' here and postpone applying other features
143 ;; to the next stage.
145 (" (m?(RH)?Z)([CRBPH]+)(Z)([RBPHbpA]*) "
146 | (1 = *) (3 otf:mlym=akhn+) (4 =) (5 otf:mlym=blwf,pstf+) |)
152 ;; Forced chillu form.
154 | (1 otf:mlym=haln,half+) (2 =) |)
156 ;; Sequence that was cut off from a forced form. Again we apply
159 | (1 otf:mlym=akhn+) |)
164 ;; Apply postoponed GSUB features to ordinary syllables.
168 ;; Ordinary syllable.
170 (" (m?(RH)?Z[^Z])([^Z]*)(Z[^ ]*) "
171 | (1 = *) (3 otf:mlym=blwf,half,pstf,haln+) (4 = *) |)
173 ;; Explicit Halant / Forced chillu must not change to others.
179 | (1 =) (2 otf:mlym=blwf,half,pstf,haln+) |)
184 ;; Second reordering. If there are glyphs before the base, move left
185 ;; vowel sign and RH to the left of the base.
190 (" (m)?(RH)?Z([^Z]*)([^Z])Z([^ ]*) "
191 | (3 = *) (1 =) (2 otf:mlym=pstf+) (4 =) (5 = *) |)
196 ;; Apply substitutions and GPOS features.
201 (1 otf:mlym=pres,abvs,blws,psts+abvm,blwm,dist))
206 ;; Copyright (C) 2003, 2004, 2005, 2007, 2008
207 ;; National Institute of Advanced Industrial Science and Technology (AIST)
208 ;; Registration Number H15PRO112
210 ;; This file is part of the m17n database; a sub-part of the m17n
213 ;; The m17n library is free software; you can redistribute it and/or
214 ;; modify it under the terms of the GNU Lesser General Public License
215 ;; as published by the Free Software Foundation; either version 2.1 of
216 ;; the License, or (at your option) any later version.
218 ;; The m17n library is distributed in the hope that it will be useful,
219 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
220 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
221 ;; Lesser General Public License for more details.
223 ;; You should have received a copy of the GNU Lesser General Public
224 ;; License along with the m17n library; if not, write to the Free
225 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
226 ;; Boston, MA 02110-1301, USA.