New file.
[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     < | (0 = *) | >)
74
75    ;; Consonant-based syllables
76    ("([CR]n?J?HJ?)*[CR]n?(H[NJ]?|m?u?b?p?n?)a?A?"
77     < | (0 = *) | >)
78
79    ;; Combining marks are displayed with a DOTTED CIRCLE.
80    ("n|H|u|b|p|a|A|JH[CR]"
81     < 0x25CC (0 :otf=bng2=blwf,pstf+) >)
82
83    ;; Pre-base matra
84    ("(m)([up])?"
85     < (1 =) 0x25CC (2 =) >)
86
87    ("." =))
88   *))
89
90 ;; Stage 2
91 ;; Basic shaping forms and matra reordering
92 (generator
93  (0
94   (cond
95    ;; Explicit halant form starting with RA + H + ZWJ
96    ;; 1            2    3   4
97    (" (RHJ[CRnHJ]+)(H)N?(a)?(A)? "
98     (1 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
99     | (1 b4post) (3 =) (1 post) (2 =) (4 =) |)
100
101    ;; Explicit halant form starting with a reph
102    ;; 1   2         3    4   5
103    (" (RH)([CRnHJ]+)(H)N?(a)?(A)? "
104     (2 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
105     | (1 :otf=ory2=rphf+) (2 b4post) (4 =) (2 post) (3 =) (5 =) |)
106
107    ;; Other explicit halant forms
108    ;; 1         2    3   4
109    (" ([CRnHJ]+)(H)N?(a)?(A)? "
110     (1 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
111     | (1 b4post) (3 =) (1 post) (2 =) (4 =) |)
112
113    ;; Ordinary syllables starting with RA + H + ZWJ
114    ;; 1            2     3       4     5   6
115    (" (RHJ[CRnHJ]*)(mn?)?(u?b?n?)(pn?)?(a)?(A)? "
116     (1 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
117     | (2 = *) (1 b4post) (3 = *) (5 =) (1 post) (4 = *) (6 =) |)
118
119    ;; Ordinary syllables starting with a reph
120    ;; 1   2          3     4       5     6   7
121    (" (RH)([CRnHJV]+)(mn?)?(u?b?n?)(pn?)?(a)?(A)? "
122     (2 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
123     | (3 = *) (1 :otf=ory2=rphf+) (2 b4post) (4 = *) (6 =) (2 post)
124     (5 = *) (7 =) |)
125
126    ;; Other ordinary syllables
127    ;; 1          2     3       4     5   6
128    (" ([CRnHJV]+)(mn?)?(u?b?n?)(pn?)?(a)?(A)? "
129     (1 :otf?ory2=locl,nukt,akhn,blwf,pstf+)
130     | (2 = *) (1 b4post) (3 = *) (5 =) (1 post) (4 = *) (6 =) |)
131
132    ("." =))
133   *)
134
135  (b4post
136   (cond
137    ("([CRnHJP]*[CRV]n?)((J?PP)+)$"
138     (1 :otf=ory2=locl,nukt,akhn,blwf,cjct+))
139    (".+"
140     (0 :otf=ory2=locl,nukt,akhn,blwf,cjct+))))
141
142  (post
143   (cond
144    ("[CRnHJP]*[CRV]n?((J?PP)+)$"
145     (1 :otf=ory2=pstf+))))
146  )
147
148 ;; Stage 3
149 ;; Final reordering #1 (Move pre-base matra after the last halant)
150 (generator
151  (0
152   (cond
153    ;; 1    2         3
154    (" (mn?)([^ ]+HJ?)([^H ]+) "
155     | (2 = *) (1 = *) (3 = *) |)
156
157    ("." =))
158   *))
159
160 ;; Stage 4
161 ;; Final reordering #2 (Move reph after the first halant)
162 (generator
163  (0
164   (cond
165    ;; Syllables with a reph and an explicit halant
166    ;; 1     2  3           4
167    (" (mn?)?(r)([^HP ]+HJ?)([^ ]*) "
168     | (1 = *) (3 = *) (2 =) (4 = *) |)
169
170    ;; A reph without explicit halant
171    ;; 1     2  3          4
172    (" (mn?)?(r)([^aPpA ]+)(a?P*H?p?n?A?) "
173     | (1 = *) (3 = *) (2 =) (4 = *) |)
174
175    ("." =))
176   *))
177
178 ;; Stage 5
179 ;; Nukta for matra and presentation forms
180 (generator
181  (0
182   (cond
183    (" ([^ ]+) "
184     | (1 :otf=ory2=nukt,pres,abvs,blws,psts,haln,calt+) |)
185
186    ("." =))
187   *))
188
189 ;; Stage 6
190 ;; Remove ZWJ
191 (generator
192  (0
193   (cond
194    ("J")
195
196    ("." =))
197   *))
198
199 ;; Stage 7
200 ;; GPOS processing
201 (generator
202  (0
203   (cond
204    (" ([^ ]+) "
205     (1 :otf=ory2=+kern,dist,abvm,blwm))
206
207    ("." =))
208   *))
209
210 ;; Copyright (C) 2010
211 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
212 ;;   Registration Number H15PRO112
213
214 ;; This file is part of the m17n database; a sub-part of the m17n
215 ;; library.
216
217 ;; The m17n library is free software; you can redistribute it and/or
218 ;; modify it under the terms of the GNU Lesser General Public License
219 ;; as published by the Free Software Foundation; either version 2.1 of
220 ;; the License, or (at your option) any later version.
221
222 ;; The m17n library is distributed in the hope that it will be useful,
223 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
224 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
225 ;; Lesser General Public License for more details.
226
227 ;; You should have received a copy of the GNU Lesser General Public
228 ;; License along with the m17n library; if not, write to the Free
229 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
230 ;; Boston, MA 02110-1301, USA.
231
232 ;; Local Variables:
233 ;; mode: emacs-lisp
234 ;; End: