1 ;; MLYM-OTF.flt -- Font Layout Table for Malayalam OpenType font
2 ;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 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 and VA, but not for RA and LA.
20 ;; RaghuMalayalamSans2.ttf
24 ;; C: ordinary consonants (except P)
25 ;; P: consonants that have a post 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 (0x0D35 ?P) ; LETTER VA
43 (0x0D3E 0x0D44 ?p) ; VOWEL SIGN AA .. VOCALIC RR
44 (0x0D46 0x0D48 ?m) ; VOWEL SIGN E .. AI
45 (0x0D4D ?H) ; SIGN VIRAMA
46 (0x0D57 ?p) ; AU LENGTH MARK
47 (0x0D60 0x0D61 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
48 (0x0D62 0x0D63 ?b) ; VOWEL SIGN VOCALIC L .. LL
49 (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
55 ;; Decompose two-part vowels.
69 ;; Syllable identification and reordering.
70 ;; Put the mark Z after the base consonant.
74 ;; A syllable with a left vowel sign.
76 ("([CP](H[CP])*)(m)(p?A?)"
77 < | (3 =) (1 move-h) (4 = *) | >)
79 ;; A syllable with a right vowel sign, a below vowel sign
80 ;; and/or a vowel modifier.
82 ("([CP](H[CP])*)(bA?|pA?|A)"
83 < | (1 move-h) (3 = *) | >)
85 ;; Forced chillu form.
88 < | (1 move-h) (3 = =) | >)
90 ;; A syllable with no vowel signs/modifiers, optionally followed by
93 ("([CP](H[CP])*)(H|HN)?"
94 < | (1 move-h) (3 0x0D4D) | >)
96 ;; Starting with an independent vowel.
104 ;; Move the halant that follows the base consonant to the end.
107 ;; All consonants are P's.
109 (1 =) 0x0D00 (3 = *) (2 =))
111 ;; One or more Non-P consonants.
112 ("([CPH]*C)(H)([PH]+)$"
113 (1 = *) 0x0D00 (3 = *) (2 =))
115 ;; Otherwise, final consonant is not P. No need to move H.
121 ;; Apply GSUB features.
125 ;; The tested fonts make LA's below form with 1. 'half' + 'blws',
126 ;; 2. 'half' + 'pres' or 3. 'akhn'.
128 (" (m)?([CPH]*)(Z)([PHbpAJ]*) "
129 | (1 =) (2 otf:mlym=akhn,half,pstf,pres,abvs,blws+) (3 =)
130 (4 otf:mlym=pstf+) |)
136 ;; Second reordering. If there are glyphs before the base, move left
137 ;; vowel sign to the left of the base.
142 (" (m)?([^Z ]*)([^Z])Z([^ ]*) "
143 | (2 = *) (1 =) (3 =) (4 = *) |)
149 ;; Apply remaining GSUB and GPOS features to all syllables. To get
150 ;; correct Y.YA and V.VA conjunctions, we must apply 'psts' to the
156 (1 otf:mlym=akhn,psts,haln+abvm,blwm,dist))
161 ;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
162 ;; National Institute of Advanced Industrial Science and Technology (AIST)
163 ;; Registration Number H15PRO112
165 ;; This file is part of the m17n database; a sub-part of the m17n
168 ;; The m17n library is free software; you can redistribute it and/or
169 ;; modify it under the terms of the GNU Lesser General Public License
170 ;; as published by the Free Software Foundation; either version 2.1 of
171 ;; the License, or (at your option) any later version.
173 ;; The m17n library is distributed in the hope that it will be useful,
174 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
175 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
176 ;; Lesser General Public License for more details.
178 ;; You should have received a copy of the GNU Lesser General Public
179 ;; License along with the m17n library; if not, write to the Free
180 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
181 ;; Boston, MA 02110-1301, USA.