*** empty log message ***
[m17n/m17n-db.git] / FLT / TML2-OTF.flt
1 ;; TML2-OTF.flt -- Font Layout Table for tml2 OpenType fonts
2 ;; Copyright (C) 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
4
5 (font layouter tml2-otf nil
6       (version "1.6.0")
7       (font (nil nil unicode-bmp :otf=tml2)))
8
9 ;;; <li> TML2-OTF.flt
10 ;;;
11 ;;; For tml2 OpenType fonts to draw the Tamil script.
12
13 (category
14  ;; X: generic
15  ;; a: ANUSVARA
16  ;; V: independent vowel
17  ;; C: consonant
18  ;; H: HALANT
19  ;; m: vowel sign (pre)
20  ;; p: vowel sign (others)
21  (0x0B80 0x0BFF ?X)                     ; generic
22  (0x0B82        ?a)                     ; SIGN ANUSVARA
23  (0x0B85 0x0B94 ?V)                     ; LETTER A .. AU
24  (0x0B95 0x0BB9 ?C)                     ; LETTER KA .. HA
25  (0x0BBE 0x0BC2 ?p)                     ; VOWEL SIGN AA .. I
26  (0x0BC6 0x0BC8 ?m)                     ; VOWEL SIGN E .. AI
27  (0x0BCD        ?H)                     ; SIGN VIRAMA
28  (0x0BD7        ?p)                     ; AU LENGTH MARK
29
30  (0x200C        ?N)                     ; ZWNJ
31  (0x200D        ?J)                     ; ZWJ
32  (0x25CC        ?X)                     ; DOTTED CIRCLE
33  )
34
35 ;; Stage 0
36 ;; Preprocessing
37 (generator
38  (0
39   (cond
40    ;; Decompose two-part vowel signs.
41    ((0x0BCA)
42     0x0BC6 0x0BBE)
43    ((0x0BCB)
44     0x0BC7 0x0BBE)
45    ((0x0BCC)
46     0x0BC6 0x0BD7)
47
48    ;; A variation of AU.
49    ((0x0B92 0x0BD7)
50     0x0B94)
51
52    ;; The SHRII ligature and its old definition
53    ((0x0BB6 0x0BCD 0x0BB0 0x0BC0)
54     (0 :otf=tml2=locl,akhn,half,cjct,pres,abvs,blws,psts,haln,calt+))
55    ((0x0BB8 0x0BCD 0x0BB0 0x0BC0)
56     (0 :otf=tml2=locl,akhn,half,cjct,pres,abvs,blws,psts,haln,calt+))
57
58    ("." =))
59   *))
60
61 ;; Stage 1
62 ;; Syllable identification and basic shaping froms
63 (generator
64  (0
65   (cond
66    ;; Consonant-based syllables
67    ("(CJ?HJ?)*C(H[NJ]?|m?p?)a?"
68     < | :otf=tml2=locl,akhn,half,cjct+ | >)
69
70    ;; Syllables with an independent vowel
71    ("Vm?p?a?"
72     < | = * | >)
73
74    ;; Two-part vowel signs
75    ((0x0BC6 0x0BBE)
76     (cond
77      ((font-facility 0x25CC) < 0x0BC6 0x25CC 0x0BBE >)
78      (".+" < 0x0BCA >)))
79    ((0x0BC7 0x0BBE)
80     (cond
81      ((font-facility 0x25CC) < 0x0BC7 0x25CC 0x0BBE >)
82      (".+" < 0x0BCB >)))
83    ((0x0BC6 0x0BD7)
84     (cond
85      ((font-facility 0x25CC) < 0x0BC6 0x25CC 0x0BD7 >)
86      (".+" < 0x0BCC >)))
87
88    ;; Combining marks are displayed with a DOTTED CIRCLE.
89    ("m"
90     (cond
91      ((font-facility 0x25CC) < = 0x25CC >)
92      ("." [ = ])))
93    ("[Hpa]"
94     (cond
95      ((font-facility 0x25CC) < 0x25CC = >)
96      ("." [ = ])))
97
98    ("." =))
99   *))
100
101 ;; Stage 2
102 ;; Move pre-base matra after the last halant, or to the beginning
103 (generator
104  (0
105   (cond
106    ;; 1         2       3  4
107    (" ([^ ]+HJ?)([^H ]+)(m)([^ ]*) "
108     | (1 = *) (3 =) (2 = *) (4 = *) |)
109
110    ;; 1      2  3
111    (" ([^ ]+)(m)([^ ]*) "
112     | (2 =) (1 = *) (3 = *) |)
113
114    ("." =))
115   *))
116
117 ;; Stage 3
118 ;; Presentation forms
119 (generator
120  (0
121   (cond
122    (" ([^ ]+) "
123     | (1 :otf=tml2=pres,abvs,blws,psts,haln,calt+) |)
124
125    ("." =))
126   *))
127
128 ;; Stage 4
129 ;; Remove ZWNJ/ZWJ
130 (generator
131  (0
132   (cond
133    ("[NJ]")
134
135    ("." =))
136   *))
137
138 ;; Stage 5
139 ;; GPOS processing
140 (generator
141  (0
142   (cond
143    (" ([^ ]+) "
144     (1 :otf=tml2=+kern,dist,abvm,blwm))
145
146    ("." =))
147   *))
148
149 ;; Copyright (C) 2010
150 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
151 ;;   Registration Number H15PRO112
152
153 ;; This file is part of the m17n database; a sub-part of the m17n
154 ;; library.
155
156 ;; The m17n library is free software; you can redistribute it and/or
157 ;; modify it under the terms of the GNU Lesser General Public License
158 ;; as published by the Free Software Foundation; either version 2.1 of
159 ;; the License, or (at your option) any later version.
160
161 ;; The m17n library is distributed in the hope that it will be useful,
162 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
163 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
164 ;; Lesser General Public License for more details.
165
166 ;; You should have received a copy of the GNU Lesser General Public
167 ;; License along with the m17n library; if not, write to the Free
168 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
169 ;; Boston, MA 02110-1301, USA.
170
171 ;; Local Variables:
172 ;; mode: emacs-lisp
173 ;; End: