1 ;; MLM2-OTF.flt -- Font Layout Table for mlm2 OpenType fonts
2 ;; Copyright (C) 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
5 (font layouter mlm2-otf nil
7 (font (nil nil unicode-bmp :otf=mlm2)))
11 ;;; For mlm2 OpenType fonts to draw the Malayalam script.
13 ;; Observed behaviour of Uniscribe in combination with kartika.ttf:
15 ;; 1. Only the last RA can take the pref form. This last RA can come
16 ;; a) just before blwf consonants
17 ;; b) between blwf consonants and pstf consonants, or
18 ;; c) after pstf consonants.
20 ;; 2. Multiple blwf forms are allowed anywhere in a syllable as long
21 ;; as the context (the combination of the preceding consonant and the
22 ;; blwf consonant) permits.
24 ;; 3. Multiple pstf forms are allowed as long as they are the last
25 ;; consonants, optionally followed by a RA.
27 ;; About chillu letters:
29 ;; The sequence "consonant + VIRAMA + ZWJ" represents a chillu letter,
30 ;; which makes an independent syllable. The only exception is "CHILLU
31 ;; N + RRA" (0D7B 0D31) and its equivalent "NA + VIRAMA + ZWJ + RRA"
32 ;; (0D28 0D4D 200D 0D31), which make a ligature.
35 (0x0D00 0x0D7F ?X) ; generic
36 (0x0D02 0x0D03 ?A) ; SIGN ANUSVARA .. VISARGA
37 (0x0D05 0x0D14 ?V) ; LETTER A .. AU
38 (0x0D15 0x0D39 ?C) ; LETTER KA .. HA
39 (0x0D3E 0x0D44 ?p) ; VOWEL SIGN AA .. VOCALIC RR
40 (0x0D46 0x0D48 ?m) ; VOWEL SIGN E .. AI
41 (0x0D4D ?H) ; SIGN VIRAMA
42 (0x0D57 ?p) ; AU LENGTH MARK
43 (0x0D60 0x0D61 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
44 (0x0D62 0x0D63 ?b) ; VOWEL SIGN VOCALIC L .. LL
48 (0x25CC ?X) ; DOTTED CIRCLE
61 ;; Decompose two-part vowel signs
62 ((0x0D4A) 0x0D46 0x0D3E)
63 ((0x0D4B) 0x0D47 0x0D3E)
64 ((0x0D4C) 0x0D46 0x0D57)
66 ;; Replace CHILLU N + RRA with a pseudo-consonant
67 ((0x0D7B 0x0D31) :otf=mlm2=akhn+)
68 ((0x0D28 0x0D4D 0x200D 0x0D31) :otf=mlm2=akhn+)
70 ;; Other chillu letters
71 ((0x0D23 0x0D4D 0x200D) 0x0D7A)
72 ((0x0D28 0x0D4D 0x200D) 0x0D7B)
73 ((0x0D30 0x0D4D 0x200D) 0x0D7C)
74 ((0x0D32 0x0D4D 0x200D) 0x0D7D)
75 ((0x0D33 0x0D4D 0x200D) 0x0D7E)
76 ((0x0D15 0x0D4D 0x200D) 0x0D7F)
82 ;; Syllable identification
86 ;; Consonant-based syllables
87 ("(CJ?HJ?)*C(H[NJ]?|m?b?p?)A?"
90 ;; Syllables with an independent vowel
94 ;; Two-part vowel signs
97 ((font-facility 0x25CC) < 0x0D46 0x25CC 0x0D3E >)
101 ((font-facility 0x25CC) < 0x0D47 0x25CC 0x0D3E >)
105 ((font-facility 0x25CC) < 0x0D46 0x25CC 0x0D57 >)
108 ;; Combining marks are displayed with a DOTTED CIRCLE.
111 ((font-facility 0x25CC) < = 0x25CC >)
115 ((font-facility 0x25CC) < 0x25CC = >)
117 ((0x200D 0x0D4D 0x0D30)
119 ((font-facility 0x25CC) < :otf=mlm2=pref+ 0x25CC >)
120 (".+" [ :otf=mlm2=pref+ ])))
123 ((font-facility 0x25CC) < 0x25CC :otf=mlm2=blwf,pstf+ >)
124 (".+" [ :otf=mlm2=blwf,pstf+ ])))
130 ;; Basic shaping forms and matra reordering
133 :otf?mlm2=locl,akhn,pref,blwf,pstf+
138 (" ([CRBPHJ]*[CRBV])((J?PP)*)J?(RR)(H[NJ]?)?(m)?(b?p?A?) "
139 | (6 =) (4 :otf=mlm2=pref+) (1 :otf=mlm2=locl,akhn,blwf,half,cjct+)
140 (2 :otf=mlm2=pstf+) (5 = *) (7 = *) |)
142 ;; pref between blwf and pstf
144 (" ([CRBPHJV]+)(RR)((J?PP)+)(H[NJ]?)?(m)?(b?p?A?) "
145 | (6 =) (2 :otf=mlm2=pref+) (1 :otf=mlm2=locl,akhn,blwf,half,cjct+)
146 (3 :otf=mlm2=pstf+) (5 = *) (7 = *) |)
150 (" ([CRBPHJV]+)(RR)((J?BB)+)((J?PP)*)(H[NJ]?)?(m)?(b?p?A?) "
151 | (8 =) (2 :otf=mlm2=pref+) (1 :otf=mlm2=locl,akhn,blwf,half,cjct+)
152 (3 :otf=mlm2=blwf+) (5 :otf=mlm2=pstf+) (7 = *) (9 = *) |)
156 (" ([CRBPHJ]*[CRBV])((J?PP)*)(H[NJ]?)?(m)?(b?p?A?) "
157 | (5 =) (1 :otf=mlm2=locl,akhn,blwf,half,cjct+) (2 :otf=mlm2=pstf+)
164 ;; Final reordering (Move pre-base matra and pre-base RA after the last halant)
169 (" (m?R?)([^ ]+H)([^H ]+) "
170 | (2 = *) (1 = *) (3 = *) |)
176 ;; Presentation forms
181 | (1 :otf=mlm2=pres,abvs,blws,psts,haln,calt+) |)
202 (1 :otf=mlm2=+kern,dist,abvm,blwm))
207 ;; Copyright (C) 2010
208 ;; National Institute of Advanced Industrial Science and Technology (AIST)
209 ;; Registration Number H15PRO112
211 ;; This file is part of the m17n database; a sub-part of the m17n
214 ;; The m17n library is free software; you can redistribute it and/or
215 ;; modify it under the terms of the GNU Lesser General Public License
216 ;; as published by the Free Software Foundation; either version 2.1 of
217 ;; the License, or (at your option) any later version.
219 ;; The m17n library is distributed in the hope that it will be useful,
220 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
221 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
222 ;; Lesser General Public License for more details.
224 ;; You should have received a copy of the GNU Lesser General Public
225 ;; License along with the m17n library; if not, write to the Free
226 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
227 ;; Boston, MA 02110-1301, USA.