Render post-base vowel sign correctly after an independent vowel.
[m17n/m17n-db.git] / FLT / TAML-CDAC.flt
1 ;; TAML-CDAC.flt -- Font Layout Table for Tamil (C-DAC font)
2 ;; Copyright (C) 2003, 2004, 2007
3 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
4 ;;   Registration Number H15PRO112
5
6 ;; This file is part of the m17n database; a sub-part of the m17n
7 ;; library.
8
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.
13
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.
18
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., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
23
24 ;;; <li> TAML-CDAC.flt
25 ;;;
26 ;;; For the font TMVL0ntt.ttf (developped by C-DAC, encoding is ISFOC)
27 ;;; to draw Tamil script.  The font is available at:
28 ;;; <ul>
29 ;;; <li>        infopage: http://www.iiit.net/ltrc/iscii/FAQ.htm#SEC2.1
30 ;;; <li> download: http://www.iiit.net/ltrc/iscii/iscii_plugin_linux.tar.gz
31 ;;; </ul>
32
33 (font layouter taml-cdac nil
34       (font (nil tm-ttvalluvar apple-roman)))
35
36 (category
37  ;; C: CONSONANT
38  ;; I: INDEPENDENT VOWEL
39  ;; R: DEPENDENT VOWEL RIGHT
40  ;; L: DEPENDENT VOWEL LEFT
41  ;; B: DEPENDENT VOWEL LEFT AND RIGHT TYPE 1
42  ;; b: DEPENDENT VOWEL LEFT AND RIGHT TYPE 2
43  ;; V: VIRAMA
44  ;; E: ELSE
45  ;;
46  (0x0B83        ?E)
47  (0x0B85 0x0B8A ?I)
48  (0x0B8E 0x0B90 ?I)
49  (0x0B92 0x0B94 ?I)
50  (0x0B95        ?C)
51  (0x0B99 0x0B9A ?C)
52  (0x0B9C        ?C)
53  (0x0B9E 0x0B9F ?C)
54  (0x0BA3 0x0BA4 ?C)
55  (0x0BA8 0x0BAA ?C)
56  (0x0BAE 0x0BB5 ?C)
57  (0x0BB7 0x0BB9 ?C)
58  (0x0BBE 0x0BC2 ?R)
59  (0x0BC6 0x0BC8 ?L)
60  (0x0BCA        ?B)
61  (0x0BCB        ?b)
62  (0x0BCC        ?B)
63  (0x0BCD        ?V)
64  (0x0BD7        ?E))
65
66 ;; CHAR->GLYPH STAGE
67 (generator
68  (0
69   (cond
70    ("((CV)*)(C)(R)"
71     (1 consonant-virama *)
72     (3 consonant)
73     (4 dependent-vowel))
74    ("((CV)*)(C)(L)"
75     < |
76     (4 dependent-vowel)
77     (1 consonant-virama *)
78     (3 consonant)
79     | >)
80    ("((CV)*)(C)(B)"
81     < |
82     0xAA
83     (1 consonant-virama *)
84     (3 consonant)
85     (4 dependent-vowel)
86     | >)
87    ("((CV)*)(C)(b)"
88     < |
89     0xAB
90     (1 consonant-virama *)
91     (3 consonant)
92     (4 dependent-vowel)
93     | >)
94    ("CV"
95     < consonant-virama >)
96    ("[RLBb]"
97     isolated-dependent-vowel)
98    ("." independent consonant))
99   *)
100
101  (consonant-virama
102   (cond
103    ((0x0B95 0x0BCD)     0xE8 0xA2)      ; k
104    ((0x0B99 0x0BCD)     0xE9 0xA2)      ; n^
105    ((0x0B9A 0x0BCD)     0xEA 0xA2)      ; c
106    ((0x0B9E 0x0BCD)     0xEB 0xA2)      ; n~
107    ((0x0B9F 0x0BCD)     0xEC 0xA2)      ; t.
108    ((0x0BA3 0x0BCD)     0xED 0xA2)      ; n.
109    ((0x0BA4 0x0BCD)     0xEE 0xA2)      ; t
110    ((0x0BA8 0x0BCD)     0xEF 0xA2)      ; n
111    ((0x0BAA 0x0BCD)     0xF0 0xA2)      ; p
112    ((0x0BAE 0x0BCD)     0xF1 0xA2)      ; m
113    ((0x0BAF 0x0BCD)     0xF2 0xA2)      ; y
114    ((0x0BB0 0x0BCD)     0xF3 0xA2)      ; r
115    ((0x0BB2 0x0BCD)     0xF4 0xA2)      ; l
116    ((0x0BB5 0x0BCD)     0xF5 0xA2)      ; v
117    ((0x0BB4 0x0BCD)     0xF6 0xA2)      ; l_
118    ((0x0BB3 0x0BCD)     0xF7 0xA2)      ; l.
119    ((0x0BB1 0x0BCD)     0xF8 0xA2)      ; r_
120    ((0x0BA9 0x0BCD)     0xA1)           ; n_
121    ((0x0BB8 0x0BCD)     0x76)           ; s
122    ((0x0BB7 0x0BCD)     0x77)           ; s'
123    ((0x0B9C 0x0BCD)     0x78)           ; j
124    ((0x0BB9 0x0BCD)     0x79)           ; h
125    ))
126
127  (consonant
128   (cond
129    ((0x0B95)    0xE8)                   ; k
130    ((0x0B99)    0xE9)                   ; n^
131    ((0x0B9A)    0xEA)                   ; c
132    ((0x0B9E)    0xEB)                   ; n~
133    ((0x0B9F)    0xEC)                   ; t.
134    ((0x0BA3)    0xED)                   ; n.
135    ((0x0BA4)    0xEE)                   ; t
136    ((0x0BA8)    0xEF)                   ; n
137    ((0x0BAA)    0xF0)                   ; p
138    ((0x0BAE)    0xF1)                   ; m
139    ((0x0BAF)    0xF2)                   ; y
140    ((0x0BB0)    0xF3)                   ; r
141    ((0x0BB2)    0xF4)                   ; l
142    ((0x0BB5)    0xF5)                   ; v
143    ((0x0BB4)    0xF6)                   ; l_
144    ((0x0BB3)    0xF7)                   ; l.
145    ((0x0BB1)    0xF8)                   ; r_
146    ((0x0BA9)    0xF9)                   ; n_
147    ((0x0BB8)    0xFA)                   ; s
148    ((0x0BB7)    0xFB)                   ; s'
149    ((0x0B9C)    0xFC)                   ; j
150    ((0x0BB9)    0xFD)                   ; h
151    ))
152    
153  (dependent-vowel
154   (cond
155    ((0x0BBE)    0xA3)                   ; a~
156    ((0x0BBF)    0xA4)                   ; i
157    ((0x0BC0)    0xA6)                   ; i~
158    ((0x0BC1)    0xA7)                   ; u
159    ((0x0BC2)    0xA8)                   ; u~
160    ((0x0BC6)    0xAA)                   ; e
161    ((0x0BC7)    0xAB)                   ; e~
162    ((0x0BC8)    0xAC)                   ; ai
163    ((0x0BCA)    0xA3)                   ; o (right part)
164    ((0x0BCB)    0xA3)                   ; o~ (right part)
165    ((0x0BCC)    0xF7)                   ; au (right part)
166    ))
167
168  (independent
169   (cond
170    ;; VOWELS
171    ((0x0B85)    0xDC)                   ; a
172    ((0x0B86)    0xDD)                   ; a~
173    ((0x0B87)    0xDE)                   ; i
174    ((0x0B88)    0xDF)                   ; i~
175    ((0x0B89)    0xE0)                   ; u
176    ((0x0B8A)    0xE1)                   ; u~
177    ((0x0B8E)    0xE2)                   ; e
178    ((0x0B8F)    0xE3)                   ; e~
179    ((0x0B90)    0xE4)                   ; ai
180    ((0x0B92)    0xE5)                   ; o
181    ((0x0B93)    0xE6)                   ; o~
182    ((0x0B94)    0xE5 0xF7)              ; au
183    ;; VISARGA
184    ((0x0B83)    0xE7)
185    ))
186
187  (isolated-dependent-vowel
188   (cond
189    ((0x0BBE)    0x81 0xA3)              ; a~
190    ((0x0BBF)    0x81 0xA4)              ; i
191    ((0x0BC0)    0x81 0xA6)              ; i~
192    ((0x0BC1)    0x81 0xA7)              ; u
193    ((0x0BC2)    0x81 0xA8)              ; u~
194    ((0x0BC6)    0xAA 0x81)              ; e
195    ((0x0BC7)    0xAB 0x81)              ; e~
196    ((0x0BC8)    0xAC 0x81)              ; ai
197    ((0x0BCA)    0xAA 0x81 0xA3)         ; o
198    ((0x0BCB)    0xAB 0x81 0xA3)         ; o~
199    ((0x0BCC)    0xAA 0x81 0xF7)         ; au
200    )))
201
202 ;; LIGATURE STAGE
203 (category
204  ;; C: CONSONANT (except for K, R, S)
205  ;; K: CONSONANT K
206  ;; R: CONSONANT R
207  ;; S: CONSONANT S'
208  ;; V: LIGATURE VOWEL (except for I,i)
209  ;; I: DEPENDENT VOWEL I
210  ;; i: DEPENDENT VOWEL I~
211  ;; L: LEFT PART OF VOWEL 
212  ;; v: VIRAMA
213  ;; E: ELSE
214  ;;
215  (0x00 0xFF     ?E)
216  (0xA2          ?v)
217  (0xE9 0xFD     ?C)
218  (0xE8          ?K)
219  (0xF3          ?R)
220  (0xFB          ?S)
221  (0xA4          ?I)                     ; i
222  (0xA6          ?i)                     ; i~
223  (0xA7 0xA8     ?V)                     ; u, u~
224  (0xAA 0xAC     ?L)
225  )
226
227 (generator
228  (0
229   (cond
230    ;; 1  23      4      5    6
231    (" (L)(([CKRS](v)?)*)(KvS)(.)? "
232     (2 = *) (1 =) (5 0xFE) (6 =))
233    ;; 1  23      4      5
234    (" (L)(([CKRS](v)?)*)([CKRS].?) "
235     (2 = *) (1 =) (5 = =))
236    ("KvS[Iiv]?"
237     ligature-ks)
238    ("[CKRS][IiV]"
239     ligature = =)
240    ("SvRi"      0xFF)
241    ("."
242     =))
243   *)
244      
245  (ligature-ks
246   (cond
247    ((0xE8 0xA2 0xFB 0xA4)       0x56)   ; ksi
248    ((0xE8 0xA2 0xFB 0xA6)       0x72)   ; ksi~
249    ((0xE8 0xA2 0xFB 0xA2)       0x7A)   ; ks
250    ((0xE8 0xA2 0xFB)            0xFE)   ; ks
251    ))
252
253  (ligature
254   (cond
255    ((0xE8 0xA2 0x76 0xA2)       0x7A)   ; ks.
256
257    ((0xE8 0xA4)         0x41)           ; ki
258    ((0xE9 0xA4)         0x42)           ; n^i
259    ((0xEA 0xA4)         0x43)           ; ci
260    ((0xEB 0xA4)         0x44)           ; n~i
261    ((0xEC 0xA4)         0xAE)           ; t.i
262    ((0xED 0xA4)         0x45)           ; n.i
263    ((0xEE 0xA4)         0x46)           ; ti
264    ((0xEF 0xA4)         0x47)           ; ni
265    ((0xF0 0xA4)         0x48)           ; pi
266    ((0xF1 0xA4)         0x49)           ; mi
267    ((0xF2 0xA4)         0x4A)           ; yi
268    ((0xF3 0xA4)         0x4B)           ; ri
269    ((0xF4 0xA4)         0x4C)           ; li
270    ((0xF5 0xA4)         0x4D)           ; vi
271    ((0xF6 0xA4)         0x4E)           ; l_i
272    ((0xF7 0xA4)         0x4F)           ; l.i
273    ((0xF8 0xA4)         0x50)           ; r_i
274    ((0xF9 0xA4)         0x51)           ; n_i
275    ((0xFA 0xA4)         0x52)           ; si
276    ((0xFB 0xA4)         0x53)           ; s'i
277    ((0xFC 0xA4)         0x54)           ; ji
278    ((0xFD 0xA4)         0x55)           ; hi
279
280    ((0xE8 0xA6)         0x57)           ; ki~
281    ((0xE9 0xA6)         0x58)           ; n^i~
282    ((0xEA 0xA6)         0x59)           ; ci~
283    ((0xEB 0xA6)         0x5A)           ; n~i~
284    ((0xEC 0xA6)         0xAF)           ; t.i~
285    ((0xED 0xA6)         0x61)           ; n.i~
286    ((0xEE 0xA6)         0x62)           ; ti~
287    ((0xEF 0xA6)         0x63)           ; ni~
288    ((0xF0 0xA6)         0x64)           ; pi~
289    ((0xF1 0xA6)         0x65)           ; mi~
290    ((0xF2 0xA6)         0x66)           ; yi~
291    ((0xF3 0xA6)         0x67)           ; ri~
292    ((0xF4 0xA6)         0x68)           ; li~
293    ((0xF5 0xA6)         0x69)           ; vi~
294    ((0xF6 0xA6)         0x6A)           ; l_i~
295    ((0xF7 0xA6)         0x6B)           ; l.i~
296    ((0xF8 0xA6)         0x6C)           ; r_i~
297    ((0xF9 0xA6)         0x6D)           ; n_i~
298    ((0xFA 0xA6)         0x6E)           ; si~
299    ((0xFB 0xA6)         0x6F)           ; s'i~
300    ((0xFC 0xA6)         0x70)           ; ji~
301    ((0xFD 0xA6)         0x71)           ; hi~
302
303    ((0xE8 0xA7)         0xB0)           ; ku
304    ((0xE9 0xA7)         0xB1)           ; n^u
305    ((0xEA 0xA7)         0xB2)           ; cu
306    ((0xEB 0xA7)         0xB3)           ; n~u
307    ((0xEC 0xA7)         0xB4)           ; t.u
308    ((0xED 0xA7)         0xB5)           ; n.u
309    ((0xEE 0xA7)         0xB6)           ; tu
310    ((0xEF 0xA7)         0xB8)           ; nu
311    ((0xF0 0xA7)         0xB9)           ; pu
312    ((0xF1 0xA7)         0xBA)           ; mu
313    ((0xF2 0xA7)         0xBB)           ; yu
314    ((0xF3 0xA7)         0xBC)           ; ru
315    ((0xF4 0xA7)         0xBD)           ; lu
316    ((0xF5 0xA7)         0xBE)           ; vu
317    ((0xF6 0xA7)         0xBF)           ; l_u
318    ((0xF7 0xA7)         0xC0)           ; l.u
319    ((0xF8 0xA7)         0xC1)           ; r_u
320    ((0xF9 0xA7)         0xC2)           ; n_u
321
322    ((0xE8 0xA8)         0xC3)           ; ku~
323    ((0xE9 0xA8)         0xC4)           ; n^u~
324    ((0xEA 0xA8)         0xC5)           ; cu~
325    ((0xEB 0xA8)         0xC6)           ; n~u~
326    ((0xEC 0xA8)         0xC7)           ; t.u~
327    ((0xED 0xA8)         0xC8)           ; n.u~
328    ((0xEE 0xA8)         0xC9)           ; tu~
329    ((0xEF 0xA8)         0xCB)           ; nu~
330    ((0xF0 0xA8)         0xCC)           ; pu~
331    ((0xF1 0xA8)         0xCD)           ; mu~
332    ((0xF2 0xA8)         0xCE)           ; yu~
333    ((0xF3 0xA8)         0xCF)           ; ru~
334    ((0xF4 0xA8)         0xD6)           ; lu~
335    ((0xF5 0xA8)         0xD7)           ; vu~
336    ((0xF6 0xA8)         0xD8)           ; l_u~
337    ((0xF7 0xA8)         0xD9)           ; l.u~
338    ((0xF8 0xA8)         0xDA)           ; r_u~
339    ((0xF9 0xA8)         0xDB)           ; n_u~
340    ))
341  )
342
343 ;; Local Variables:
344 ;; mode: lisp
345 ;; End: