1 ;; DEVA-OTF.flt -- Font Layout Table for Devanagari OpenType fonts
2 ;; Copyright (C) 2003, 2004, 2007, 2008, 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
5 (font layouter deva-otf nil
7 (font (nil nil unicode-bmp :otf=deva)))
11 ;;; For Devanagari OpenType fonts to draw the Devanagari script.
13 ;; Accepted modifier sequence:
14 ;; 1. matra (pre, below, above, post)
15 ;; 2. candrabindu (0901) or anusvara (0902)
16 ;; 3. udatta (0951) or anudatta (0952)
17 ;; 4. grave (0953) or acute (0954)
20 ;; Rendering glyph order:
23 ;; 3. above- or post matra
25 ;; 5. candrabindu (0901) or anusvara (0902)
31 ;; V: independent vowel
32 ;; C: consonant (except for RA)
36 ;; m: vowel sign (pre)
37 ;; u: vowel sign (above)
38 ;; b: vowel sign (below)
39 ;; p: vowel sign (post)
40 ;; a: vowel modifier (above)
41 ;; A: vowel modifier (post)
42 ;; s: stress sign / accent (above)
43 ;; S: stress sign (below)
47 (0x0900 0x097F ?X) ; generic
48 (0x0900 0x0902 ?a) ; SIGN INVERTED CANDRABINDU .. ANUSVARA
49 (0x0903 ?A) ; SIGN VISARGA
50 (0x0904 0x0914 ?V) ; LETTER SHORT A .. AU
51 (0x0915 0x0939 ?C) ; LETTER KA .. HA
52 (0x0930 ?R) ; LETTER RA
53 (0x093C ?n) ; SIGN NUKTA
54 (0x093E ?p) ; VOWEL SIGN AA
55 (0x093F ?m) ; VOWEL SIGN I
56 (0x0940 ?p) ; VOWEL SIGN II
57 (0x0941 0x0944 ?b) ; VOWEL SIGN UU .. VOCALIC RR
58 (0x0945 0x0948 ?u) ; VOWEL SIGN CANDRA E .. AI
59 (0x0949 0x094C ?p) ; VOWEL SIGN CANDRA O .. AU
60 (0x094D ?H) ; SIGN VIRAMA
61 (0x094E ?m) ; VOWEL SIGN PRISHTHAMATRA E
62 (0x0951 ?s) ; STRESS SIGN UDATTA
63 (0x0952 ?S) ; STRESS SIGN ANUDATTA
64 (0x0953 0x0954 ?t) ; GRAVE ACCENT .. ACUTE ACCENT
65 (0x0955 ?u) ; VOWEL SIGN CHANDRA LONG E
66 (0x0958 0x095F ?C) ; LETTER QA .. YYA
67 (0x0960 0x0961 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
68 (0x0962 0x0963 ?b) ; VOWEL SIGN VOCALIC L .. VOCALIC LL
69 (0x0972 ?V) ; LETTER CANDRA A
70 (0x0979 0x097F ?C) ; LETTER ZHA .. BBA
74 (0x25CC ?X) ; DOTTED CIRCLE
84 ;; Compose a consonant and a nukta
85 ((0x0928 0x093C) 0x0929)
86 ((0x0930 0x093C) 0x0931)
87 ((0x0933 0x093C) 0x0934)
88 ((0x0915 0x093C) 0x0958)
89 ((0x0916 0x093C) 0x0959)
90 ((0x0917 0x093C) 0x095A)
91 ((0x091C 0x093C) 0x095B)
92 ((0x0921 0x093C) 0x095C)
93 ((0x0922 0x093C) 0x095D)
94 ((0x092B 0x093C) 0x095E)
95 ((0x092F 0x093C) 0x095F)
101 ;; Syllable identification
105 ;; Syllables with an independent vowel
107 ("(RH)?(Vn?)((J?HR)?m?u?b?p?n?a?[sS]?t?A?)"
108 < | (1 = =) (2 :otf=deva=nukt+) (3 = *) | >)
110 ;; Consonant-based syllables
112 ("([CR]n?((J?H|HJ?)[CR]n?)*)(H[NJ]?|m?u?b?p?n?a?[sS]?t?A?)"
113 < | (1 :otf=deva=nukt,akhn+)
115 ("(H)N?" (1 =) 0x200C)
118 ;; Combining marks are displayed with a DOTTED CIRCLE.
121 ((font-facility 0x25CC) < = 0x25CC >)
125 ((font-facility 0x25CC) < 0x25CC = >)
128 ;; Isolated blwf is displayed with a DOTTED CIRCLE in the next stage.
130 < | (1 =) (3 =) (2 =) | >)
136 ;; Reorder halant for blwf
143 ((font-facility 0x25CC) < 0x25CC :otf=deva=blwf+ >)
144 (" J(RH) " [ (1 :otf=deva=blwf+) ])))
146 ;; Syllables with an overt halant
147 (" (RHJ?)?([^ ]+)(HN) "
148 | (1 = *) (2 reorder *) (3 = =) |)
150 ;; Ordinary syllables
151 (" (RHJ?)?([^mubpasStA ]+)(m?u?b?p?n?a?[sS]?t?A?) "
152 | (1 = *) (2 reorder *) (3 = *) |)
157 ;; In Devanagari and Gujarati, vattu has a half form. Thus we handle
158 ;; the sequence CHRHC as (CH)half + (RH)blwf + C instead of
159 ;; reordering and interpreting it as C + (RH)blwf + H + C.
162 ("J?(H)(R)$" (2 =) (1 =))
168 ;; Language forms and matra reordering
172 ;; Overt halant forms
173 (" (RHJ?)?([^ ]+)(HN) "
175 (1 (cond ("RHJ" :otf=deva=half+)
176 ("RH" :otf=deva=rphf+)))
177 (2 (cond ("(.H)(.+)" (1 :otf=deva=half+) (2 :otf=deva=blwf,half+))
178 (".+" :otf=deva=blwf,half+)))
183 (" (RHJ?)?([^mubpasStA ]*)(mn?)?(un?)?(bn?)?(p?n?a?)(S)?(s?t?A?) "
185 (1 (cond ("RHJ" :otf=deva=half+)
186 ("RH" :otf=deva=rphf+)))
187 (2 (cond ("(.H)(.+)" (1 :otf=deva=half+) (2 :otf=deva=blwf,half+))
188 (".+" :otf=deva=blwf,half+)))
189 (5 = *) (7 =) (4 = *) (6 = *) (8 = *) |)
195 ;; Final reordering #1 (Move pre-base matra after the last halant)
200 (" (mn?)([^ ]+HJ?)([^H ]+) "
201 | (2 = *) (1 = *) (3 = *) |)
207 ;; Final reordering #2 (Move reph after the first halant)
211 ;; Syllables with a reph and an explicit halant
213 (" (mn?)?(r)([^H ]+HJ?)([^ ]*) "
214 | (1 = *) (3 = *) (2 =) (4 = *) |)
216 ;; A reph without explicit halant
218 (" (mn?)?(r)([^astA ]+)(a?s?t?A?) "
219 | (1 = *) (3 = *) (2 =) (4 = *) |)
225 ;; Nukta for matra, vattu and presentation forms
230 | (1 :otf=deva=nukt,vatu,pres,abvs,blws,psts,haln+) |)
251 (1 :otf=deva=+abvm,blwm,dist))
256 ;; Copyright (C) 2003, 2004, 2007, 2008, 2010
257 ;; National Institute of Advanced Industrial Science and Technology (AIST)
258 ;; Registration Number H15PRO112
260 ;; This file is part of the m17n database; a sub-part of the m17n
263 ;; The m17n library is free software; you can redistribute it and/or
264 ;; modify it under the terms of the GNU Lesser General Public License
265 ;; as published by the Free Software Foundation; either version 2.1 of
266 ;; the License, or (at your option) any later version.
268 ;; The m17n library is distributed in the hope that it will be useful,
269 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
270 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
271 ;; Lesser General Public License for more details.
273 ;; You should have received a copy of the GNU Lesser General Public
274 ;; License along with the m17n library; if not, write to the Free
275 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
276 ;; Boston, MA 02110-1301, USA.