Do not require liga as a GSUB feature.
[m17n/m17n-db.git] / FLT / ORY2-OTF.flt
1 ;; ORY2-OTF.flt -- Font Layout Table for ory2 OpenType fonts
2 ;; Copyright (C) 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
4
5 (font layouter ory2-otf nil
6       (version "1.6.0")
7       (font (nil nil unicode-bmp :otf=ory2)))
8
9 ;;; <li> ORY2-OTF.flt
10 ;;;
11 ;;; For ory2 OpenType fonts to draw the Oriya script.
12
13 ;; base blwf b u rphf a pstf p A
14
15 (category
16  (0x0B00 0x0B7F ?X)                     ; generic
17  (0x0B01        ?a)                     ; SIGN CANDRABINDU
18  (0x0B02 0x0B03 ?A)                     ; SIGN ANUSVARA .. VISARGA
19  (0x0B05 0x0B14 ?V)                     ; LETTER A .. VOCALIC AU
20  (0x0B15 0x0B39 ?C)                     ; LETTER KA .. HA
21  (0x0B30        ?R)                     ; LETTER RA
22  (0x0B3C        ?n)                     ; SIGN NUKTA
23  (0x0B3E        ?p)                     ; VOWEL SIGN AA
24  (0x0B3F        ?u)                     ; VOWEL SIGN I
25  (0x0B40        ?p)                     ; VOWEL SIGN II
26  (0x0B41 0x0B44 ?b)                     ; VOWEL SIGN U .. VOCALIC RR
27  (0x0B47        ?m)                     ; VOWEL SIGN E
28  (0x0B4D        ?H)                     ; SIGN VIRAMA
29  (0x0B56        ?u)                     ; AI LENGTH MARK
30  (0x0B57        ?p)                     ; AU LENGTH MARK
31  (0x0B5C 0x0B5F ?C)                     ; LETTER RRA .. YYA
32  (0x0B60 0x0B61 ?V)                     ; LETTER VOCALIC RR .. LL
33  (0x0B62 0x0B63 ?b)                     ; VOWEL SIGN VOCALIC L .. LL
34  (0x0B71        ?C)                     ; LETTER WA
35
36  (0x200C        ?N)                     ; ZWNJ
37  (0x200D        ?J)                     ; ZWJ
38  (0x25CC        ?X)                     ; DOTTED CIRCLE
39
40  (rphf          ?r)
41  (pstf          ?P)
42  )
43
44 ;; Stage 0
45 ;; Preprocessing
46 (generator
47  (0
48   (cond
49    ;; Decompose two-part vowel signs.
50    ((0x0B48)
51     0x0B47 0x0B56)
52    ((0x0B4B)
53     0x0B47 0x0B3E)
54    ((0x0B4C)
55     0x0B47 0x0B57)
56
57    ;; Compose consonant and nukta.
58    ((0x0B21 0x0B3C)
59     0x0B5C)
60    ((0x0B22 0x0B3C)
61     0x0B5D)
62
63    ("." =))
64   *))
65
66 ;; Stage 1
67 ;; Syllable identification
68 (generator
69  (0
70   (cond
71    ;; Syllables with an independent vowel
72    ("(RH)?Vn?(J?H[CR])?m?u?b?p?n?a?A?"
73     < | = * | >)
74
75    ;; Consonant-based syllables
76    ("([CR]n?J?HJ?)*[CR]n?(H[NJ]?|m?u?b?p?n?)a?A?"
77     < | = * | >)
78
79    ;; Two-part vowel signs
80    ((0x0B47 0x0B56)
81     (cond
82      ((font-facility 0x25CC) < 0x0B47 0x25CC 0x0B56 >)
83      (".+" < 0x0B48 >)))
84    ((0x0B47 0x0B3E)
85     (cond
86      ((font-facility 0x25CC) < 0x0B47 0x25CC 0x0B3E >)
87      (".+" < 0x0B4B >)))
88    ((0x0B47 0x0B57)
89     (cond
90      ((font-facility 0x25CC) < 0x0B47 0x25CC 0x0B57 >)
91      (".+" < 0x0B4C >)))
92
93    ;; Combining marks are displayed with a DOTTED CIRCLE.
94    ("m"
95     (cond
96      ((font-facility 0x25CC) < = 0x25CC >)
97      ("." [ = ])))
98    ("[nHubpaA]"
99     (cond
100      ((font-facility 0x25CC) < 0x25CC = >)
101      ("." [ = ])))
102    ("JH[CR]"
103     (cond
104      ((font-facility 0x25CC) < 0x25CC :otf=ory2=blwf,pstf+ >)
105      (".+" [ :otf=ory2=blwf,pstf+ ])))
106
107    ("." =))
108   *))
109
110 ;; Stage 2
111 ;; Basic shaping forms and matra reordering
112 (generator
113  (0
114   (cond
115    ;; Explicit halant form starting with RA + H + ZWJ
116    ;; 1            2    3   4
117    (" (RHJ[CRnHJ]+)(H)N?(a)?(A)? "
118     (1 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
119     | (1 b4post) (3 =) (1 post) (2 =) (4 =) |)
120
121    ;; Explicit halant form starting with a reph
122    ;; 1   2         3    4   5
123    (" (RH)([CRnHJ]+)(H)N?(a)?(A)? "
124     (2 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
125     | (1 :otf=ory2=rphf+) (2 b4post) (4 =) (2 post) (3 =) (5 =) |)
126
127    ;; Other explicit halant forms
128    ;; 1         2    3   4
129    (" ([CRnHJ]+)(H)N?(a)?(A)? "
130     (1 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
131     | (1 b4post) (3 =) (1 post) (2 =) (4 =) |)
132
133    ;; Ordinary syllables starting with RA + H + ZWJ
134    ;; 1            2     3       4     5   6
135    (" (RHJ[CRnHJ]*)(mn?)?(u?b?n?)(pn?)?(a)?(A)? "
136     (1 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
137     | (2 = *) (1 b4post) (3 = *) (5 =) (1 post) (4 = *) (6 =) |)
138
139    ;; Ordinary syllables starting with a reph
140    ;; 1   2          3     4       5     6   7
141    (" (RH)([CRnHJV]+)(mn?)?(u?b?n?)(pn?)?(a)?(A)? "
142     (2 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
143     | (3 = *) (1 :otf=ory2=rphf+) (2 b4post) (4 = *) (6 =) (2 post)
144     (5 = *) (7 =) |)
145
146    ;; Other ordinary syllables
147    ;; 1          2     3       4     5   6
148    (" ([CRnHJV]+)(mn?)?(u?b?n?)(pn?)?(a)?(A)? "
149     (1 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
150     | (2 = *) (1 b4post) (3 = *) (5 =) (1 post) (4 = *) (6 =) |)
151
152    ("." =))
153   *)
154
155  (b4post
156   (cond
157    ("([CRnHJP]*[CRV]n?)((J?PP)+)$"
158     (1 :otf=ory2=locl,nukt,akhn,blwf,cjct+))
159    (".+"
160     (0 :otf=ory2=locl,nukt,akhn,blwf,cjct+))))
161
162  (post
163   (cond
164    ("[CRnHJP]*[CRV]n?((J?PP)+)$"
165     (1 :otf=ory2=pstf+))))
166  )
167
168 ;; Stage 3
169 ;; Final reordering #1 (Move pre-base matra after the last halant)
170 (generator
171  (0
172   (cond
173    ;; 1    2         3
174    (" (mn?)([^ ]+HJ?)([^H ]+) "
175     | (2 = *) (1 = *) (3 = *) |)
176
177    ("." =))
178   *))
179
180 ;; Stage 4
181 ;; Final reordering #2 (Move reph after the first halant)
182 (generator
183  (0
184   (cond
185    ;; Syllables with a reph and an explicit halant
186    ;; 1     2  3           4
187    (" (mn?)?(r)([^HP ]+HJ?)([^ ]*) "
188     | (1 = *) (3 = *) (2 =) (4 = *) |)
189
190    ;; A reph without explicit halant
191    ;; 1     2  3          4
192    (" (mn?)?(r)([^aPpA ]+)(a?P*H?p?n?A?) "
193     | (1 = *) (3 = *) (2 =) (4 = *) |)
194
195    ("." =))
196   *))
197
198 ;; Stage 5
199 ;; Nukta for matra and presentation forms
200 (generator
201  (0
202   (cond
203    (" ([^ ]+) "
204     | (1 :otf=ory2=nukt,pres,abvs,blws,psts,haln,calt+) |)
205
206    ("." =))
207   *))
208
209 ;; Stage 6
210 ;; Remove ZWJ
211 (generator
212  (0
213   (cond
214    ("J")
215
216    ("." =))
217   *))
218
219 ;; Stage 7
220 ;; GPOS processing
221 (generator
222  (0
223   (cond
224    (" ([^ ]+) "
225     (1 :otf=ory2=+kern,dist,abvm,blwm))
226
227    ("." =))
228   *))
229
230 ;; Copyright (C) 2010
231 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
232 ;;   Registration Number H15PRO112
233
234 ;; This file is part of the m17n database; a sub-part of the m17n
235 ;; library.
236
237 ;; The m17n library is free software; you can redistribute it and/or
238 ;; modify it under the terms of the GNU Lesser General Public License
239 ;; as published by the Free Software Foundation; either version 2.1 of
240 ;; the License, or (at your option) any later version.
241
242 ;; The m17n library is distributed in the hope that it will be useful,
243 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
244 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
245 ;; Lesser General Public License for more details.
246
247 ;; You should have received a copy of the GNU Lesser General Public
248 ;; License along with the m17n library; if not, write to the Free
249 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
250 ;; Boston, MA 02110-1301, USA.
251
252 ;; Local Variables:
253 ;; mode: emacs-lisp
254 ;; End: