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