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)
46 (0x0900 0x097F ?X) ; generic
47 (0x0900 0x0902 ?a) ; SIGN INVERTED CANDRABINDU .. ANUSVARA
48 (0x0903 ?A) ; SIGN VISARGA
49 (0x0904 0x0914 ?V) ; LETTER SHORT A .. AU
50 (0x0915 0x0939 ?C) ; LETTER KA .. HA
51 (0x0930 ?R) ; LETTER RA
52 (0x093C ?n) ; SIGN NUKTA
53 (0x093E ?p) ; VOWEL SIGN AA
54 (0x093F ?m) ; VOWEL SIGN I
55 (0x0940 ?p) ; VOWEL SIGN II
56 (0x0941 0x0944 ?b) ; VOWEL SIGN UU .. VOCALIC RR
57 (0x0945 0x0948 ?u) ; VOWEL SIGN CANDRA E .. AI
58 (0x0949 0x094C ?p) ; VOWEL SIGN CANDRA O .. AU
59 (0x094D ?H) ; SIGN VIRAMA
60 (0x094E ?m) ; VOWEL SIGN PRISHTHAMATRA E
61 (0x0951 ?s) ; STRESS SIGN UDATTA
62 (0x0952 ?S) ; STRESS SIGN ANUDATTA
63 (0x0953 0x0954 ?t) ; GRAVE ACCENT .. ACUTE ACCENT
64 (0x0955 ?u) ; VOWEL SIGN CHANDRA LONG E
65 (0x0958 0x095F ?C) ; LETTER QA .. YYA
66 (0x0960 0x0961 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
67 (0x0962 0x0963 ?b) ; VOWEL SIGN VOCALIC L .. VOCALIC LL
68 (0x0972 ?V) ; LETTER CANDRA A
69 (0x0979 0x097F ?C) ; LETTER ZHA .. BBA
73 (0x25CC ?X) ; DOTTED CIRCLE
83 ;; Compose a consonant and a nukta
84 ((0x0928 0x093C) 0x0929)
85 ((0x0930 0x093C) 0x0931)
86 ((0x0933 0x093C) 0x0934)
87 ((0x0915 0x093C) 0x0958)
88 ((0x0916 0x093C) 0x0959)
89 ((0x0917 0x093C) 0x095A)
90 ((0x091C 0x093C) 0x095B)
91 ((0x0921 0x093C) 0x095C)
92 ((0x0922 0x093C) 0x095D)
93 ((0x092B 0x093C) 0x095E)
94 ((0x092F 0x093C) 0x095F)
100 ;; Syllable identification
104 ;; Syllables with an independent vowel
106 ("(RH)?(Vn?)((J?HR)?m?u?b?p?n?a?[sS]?t?A?)"
107 < | (1 = =) (2 :otf=deva=nukt+) (3 = *) | >)
109 ;; Consonant-based syllables
111 ("([CR]n?((J?H|HJ?)[CR]n?)*)(H[NJ]?|m?u?b?p?n?a?[sS]?t?A?)"
114 (".+HJ$" :otf=deva=nukt,akhn+)
115 ("(.+)(H)N?$" (1 :otf=deva=nukt,akhn+) (2 =) 0x200C)
116 (".+" :otf=deva=nukt,akhn+))
119 ;; Combining marks are displayed with a DOTTED CIRCLE.
122 ((font-facility 0x25CC) < = 0x25CC >)
126 ((font-facility 0x25CC) < 0x25CC = >)
129 ;; Isolated blwf is displayed with a DOTTED CIRCLE in the next stage.
131 < | (1 =) (3 =) (2 =) | >)
137 ;; Reorder halant for blwf
144 ((font-facility 0x25CC) < 0x25CC :otf=deva=blwf+ >)
145 (" J(RH) " [ (1 :otf=deva=blwf+) ])))
147 ;; Syllables with an overt halant
148 (" (RHJ?)?([^ ]+)(HN) "
149 | (1 = *) (2 reorder) (3 = =) |)
151 ;; Ordinary syllables
152 (" (RHJ?)?([^mubpasStA ]+)(m?u?b?p?n?a?[sS]?t?A?) "
153 | (1 = *) (2 reorder) (3 = *) |)
158 ;; In Devanagari and Gujarati, vattu has a half form. Thus we handle
159 ;; the sequence CHRHC as (CH)half + (RH)blwf + C instead of
160 ;; reordering and interpreting it as C + (RH)blwf + H + C.
163 ("(.+)(H)(R)$" (1 = *) (3 =) (2 =))
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)J?(.*)" (1 :otf=deva=half+) (2 lang-forms *))
178 (".+" lang-forms *)))
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)J?(.*)" (1 :otf=deva=half+) (2 lang-forms *))
188 (".+" lang-forms *)))
189 (5 = *) (7 =) (4 = *) (6 = *) (8 = *) |)
196 ("(.H)J" (1 :otf=deva=half+))
197 (".H" :otf=deva=blwf,half+)
202 ;; Final reordering #1 (Move pre-base matra after the last halant)
207 (" (mn?)([^ ]+HJ?)([^H ]+) "
208 | (2 = *) (1 = *) (3 = *) |)
214 ;; Final reordering #2 (Move reph after the first halant)
218 ;; Syllables with a reph and an explicit halant
220 (" (mn?)?(r)([^H ]+HJ?)([^ ]*) "
221 | (1 = *) (3 = *) (2 =) (4 = *) |)
223 ;; A reph without explicit halant
225 (" (mn?)?(r)([^astA ]+)(a?s?t?A?) "
226 | (1 = *) (3 = *) (2 =) (4 = *) |)
232 ;; Nukta for matra, vattu and presentation forms
237 | (1 :otf=deva=nukt,vatu,pres,abvs,blws,psts,haln+) |)
258 (1 :otf=deva=+abvm,blwm,dist))
263 ;; Copyright (C) 2003, 2004, 2007, 2008, 2010
264 ;; National Institute of Advanced Industrial Science and Technology (AIST)
265 ;; Registration Number H15PRO112
267 ;; This file is part of the m17n database; a sub-part of the m17n
270 ;; The m17n library is free software; you can redistribute it and/or
271 ;; modify it under the terms of the GNU Lesser General Public License
272 ;; as published by the Free Software Foundation; either version 2.1 of
273 ;; the License, or (at your option) any later version.
275 ;; The m17n library is distributed in the hope that it will be useful,
276 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
277 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
278 ;; Lesser General Public License for more details.
280 ;; You should have received a copy of the GNU Lesser General Public
281 ;; License along with the m17n library; if not, write to the Free
282 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
283 ;; Boston, MA 02110-1301, USA.