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.
12 ;; Tested with the following fonts. All of these fonts require Halant
13 ;; movement for syllable-final YA, LA and VA, but not for RA.
20 ;; RaghuMalayalamSans2.ttf
24 ;; C: ordinary consonants (except P)
25 ;; P: consonants that have a post- or below-form
27 ;; m: vowel sign (pre)
28 ;; b: vowel sign (below)
29 ;; p: vowel sign (post)
30 ;; A: vowel modifier (post)
31 ;; V: independent vowel
32 ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
33 ;; J: ZWJ (ZERO WIDTH JOINER)
36 (0x0D00 0x0D7F ?X) ; generic
37 (0x0D00 ?Z) ; internal use
38 (0x0D02 0x0D03 ?A) ; SIGN ANUSVARA .. VISARGA
39 (0x0D05 0x0D14 ?V) ; LETTER A .. AU
40 (0x0D15 0x0D39 ?C) ; LETTER KA .. HA
41 (0x0D2F ?P) ; LETTER YA
42 (0x0D32 ?P) ; LETTER LA
43 (0x0D35 ?P) ; LETTER VA
44 (0x0D3E 0x0D44 ?p) ; VOWEL SIGN AA .. VOCALIC RR
45 (0x0D46 0x0D48 ?m) ; VOWEL SIGN E .. AI
46 (0x0D4D ?H) ; SIGN VIRAMA
47 (0x0D57 ?p) ; AU LENGTH MARK
48 (0x0D60 0x0D61 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
49 (0x0D62 0x0D63 ?b) ; VOWEL SIGN VOCALIC L .. LL
50 (0x0D7A 0x0D7F ?C) ; LETTER CHILLU NN .. K
51 (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
57 ;; Decompose two-part vowels.
71 ;; Syllable identification and reordering.
72 ;; Put the mark Z after the base consonant.
76 ;; A syllable with a left vowel sign.
78 ("([CP](H[CP])*)(m)(p?A?)"
79 < | (3 =) (1 move-h) (4 = *) | >)
81 ;; A syllable with a right vowel sign, a below vowel sign
82 ;; and/or a vowel modifier.
84 ("([CP](H[CP])*)(bA?|pA?|A)"
85 < | (1 move-h) (3 = *) | >)
87 ;; Explicit Halant / forced chillu form is separated from the
88 ;; preceding characters.
90 ("(([CP]H)*)([CP]H[NJ])"
91 (1 < | cut-off | >) (3 < | = * | >))
93 ;; A syllable with no vowel signs/modifiers.
97 ;; Starting with an independent vowel.
105 ;; Move the halant that follows the base consonant to the end.
108 ;; All consonants are P's.
110 (1 =) 0x0D00 (3 = *) (2 =))
112 ;; One or more Non-P consonants.
113 ("([CPH]*C)(H)([PH]+)$"
114 (1 = *) 0x0D00 (3 = *) (2 =))
116 ;; Otherwise, final consonant is not P. No need to move H.
120 ;; If there are some letters, make them a separate syllable.
128 ;; Apply 'akhn' feature.
132 ;; Ordinary syllable. We must avoid applying 'blwf' and 'pstf' to
133 ;; the first consonant if it is a P, but 'akhn' must be applied
134 ;; always. Other GSUB features are applied in the following
138 (" (m)?([CPH]*)(Z)([PHbpA]*) "
139 | (1 =) (2 otf:mlym=akhn+) (3 =) (4 otf:mlym=blwf,pstf+) |)
145 ;; Apply 'blwf' to non-initial glyphs.
150 (" (m?[^Z])([^Z ]*)(Z[^ ]*) "
151 | (1 = *) (2 otf:mlym=blwf+) (3 = *) |)
157 ;; Apply other language forms.
161 ;; All characters should have the 'half' form glyph, and 'pstf' is
162 ;; always applied after 'half'. Thus we do not need to worry
163 ;; about applying 'pstf' to the first glyph.
165 (" (m)?([^Z ]*)(Z[^ ]*) "
166 | (1 = *) (2 otf:mlym=half,pstf+) (3 = *) |)
172 ;; Forced chillu form. According to Microsoft Typography
173 ;; <http://www.microsoft.com/typography/otfntdev/malayot/features.htm>
174 ;; 'chillu' glyphs are generated with the 'haln' feature. However,
175 ;; some fonts generate them with 'half'.
177 | (1 otf:mlym=haln,half+) |)
183 ;; Second reordering. If there are glyphs before the base, move left
184 ;; vowel sign to the left of the base.
189 (" (m)?([^Z ]*)([^Z])Z([^ ]*) "
190 | (2 = *) (1 =) (3 =) (4 = *) |)
196 ;; Apply typographical forms, 'haln' and GPOS features.
201 (1 otf:mlym=pres,abvs,blws,psts,haln+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.