Add dev2, bng2, gur2, gjr2, ory2, tml2, tel2, knd2 and mlm2.
[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     < | (0 :otf=tml2=locl,akhn,half,cjct+) | >)
69
70    ;; Syllables with an independent vowel
71    ("Vm?p?a?"
72     < | (0 = *) | >)
73
74    ;; Combining marks are displayed with a DOTTED CIRCLE.
75    ("H|p|a"
76     < 0x25CC (0 =) >)
77
78    ;; Pre-base matra
79    ("(m)(p)?"
80     < (1 =) 0x25CC (2 =) >)
81
82    ("." =))
83   *))
84
85 ;; Stage 2
86 ;; Move pre-base matra after the last halant, or to the beginning
87 (generator
88  (0
89   (cond
90    ;; 1         2       3  4
91    (" ([^ ]+HJ?)([^H ]+)(m)([^ ]*) "
92     | (1 = *) (3 =) (2 = *) (4 = *) |)
93
94    ;; 1      2  3
95    (" ([^ ]+)(m)([^ ]*) "
96     | (2 =) (1 = *) (3 = *) |)
97
98    ("." =))
99   *))
100
101 ;; Stage 3
102 ;; Presentation forms
103 (generator
104  (0
105   (cond
106    (" ([^ ]+) "
107     | (1 :otf=tml2=pres,abvs,blws,psts,haln,calt+) |)
108
109    ("." =))
110   *))
111
112 ;; Stage 4
113 ;; Remove ZWNJ/ZWJ
114 (generator
115  (0
116   (cond
117    ("[NJ]")
118
119    ("." =))
120   *))
121
122 ;; Stage 5
123 ;; GPOS processing
124 (generator
125  (0
126   (cond
127    (" ([^ ]+) "
128     (1 :otf=tml2=+kern,dist,abvm,blwm))
129
130    ("." =))
131   *))
132
133 ;; Copyright (C) 2010
134 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
135 ;;   Registration Number H15PRO112
136
137 ;; This file is part of the m17n database; a sub-part of the m17n
138 ;; library.
139
140 ;; The m17n library is free software; you can redistribute it and/or
141 ;; modify it under the terms of the GNU Lesser General Public License
142 ;; as published by the Free Software Foundation; either version 2.1 of
143 ;; the License, or (at your option) any later version.
144
145 ;; The m17n library is distributed in the hope that it will be useful,
146 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
147 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
148 ;; Lesser General Public License for more details.
149
150 ;; You should have received a copy of the GNU Lesser General Public
151 ;; License along with the m17n library; if not, write to the Free
152 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
153 ;; Boston, MA 02110-1301, USA.
154
155 ;; Local Variables:
156 ;; mode: emacs-lisp
157 ;; End: