1 ;; DEVA-OTF.flt -- Font Layout Table for Devanagari OpenType font
2 ;; Copyright (C) 2003, 2004, 2007 AIST (H15PRO112)
3 ;; See the end for copying conditions.
5 (font layouter deva-otf nil
6 (font (nil nil unicode-bmp :otf=deva=rphf)))
10 ;;; For Devanagari OpenType fonts to draw the Devanagari script.
14 ;; C: consonant (except for RA)
18 ;; m: vowel sign (pre)
19 ;; u: vowel sign (above)
20 ;; b: vowel sign (below)
21 ;; p: vowel sign (post)
22 ;; A: vowel modifier (above)
23 ;; a: vowel modifier (post)
24 ;; S: stress sign / accent (above)
25 ;; s: stress sign / accent (below)
26 ;; V: independent vowel
30 (0x0900 0x097F ?X) ; generic
31 (0x0900 ?Z) ; internal use
32 (0x0901 0x0902 ?A) ; SIGN CANDRABINDU .. ANUSVARA
33 (0x0903 ?a) ; SIGN VISARGA
34 (0x0904 0x0914 ?V) ; LETTER SHORT A .. AU
35 (0x0915 0x0939 ?C) ; LETTER KA .. HA
36 (0x0930 ?R) ; LETTER RA
37 (0x093C ?n) ; SIGN NUKTA
38 (0x093E ?p) ; VOWEL SIGN AA
39 (0x093F ?m) ; VOWEL SIGN I
40 (0x0940 ?p) ; VOWEL SIGN II
41 (0x0941 0x0944 ?b) ; VOWEL SIGN UU .. VOCALIC RR
42 (0x0945 0x0948 ?u) ; VOWEL SIGN CANDRA E .. AI
43 (0x0949 0x094C ?p) ; VOWEL SIGN CANDRA O .. AU
44 (0x094D ?H) ; SIGN VIRAMA
45 (0x0951 ?S) ; STRESS SIGN UDATTA
46 (0x0952 ?s) ; STRESS SIGN ANUDATTA
47 (0x0953 0x0954 ?S) ; GRAVE ACCENT .. ACUTE ACCENT
48 (0x0958 0x095F ?C) ; LETTER QA .. YYA
49 (0x0960 0x0961 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
50 (0x0962 0x0963 ?b) ; VOWEL SIGN VOCALIC L .. VOCALIC LL
51 (0x0972 ?V) ; LETTER CANDRA A
52 (0x097B 0x097C ?C) ; LETTER GGA .. JJA
53 (0x097E 0x097F ?C) ; LETTER DDDA .. BBA
59 ;; Compose consonant and nukta
63 ((0x0928 0x093C) 0x0929)
64 ((0x0930 0x093C) 0x0931)
65 ((0x0933 0x093C) 0x0934)
66 ((0x0915 0x093C) 0x0958)
67 ((0x0916 0x093C) 0x0959)
68 ((0x0917 0x093C) 0x095A)
69 ((0x091C 0x093C) 0x095B)
70 ((0x0921 0x093C) 0x095C)
71 ((0x0922 0x093C) 0x095D)
72 ((0x092B 0x093C) 0x095E)
73 ((0x092F 0x093C) 0x095F)
78 ;; Syllable identification and eordering.
82 ;; A syllable containing a vowel sign.
84 ("([CR]n?(HJ?[CR]n?)*)((m)|(b)|(u|p))(A)?(a)?(S)?(s)?"
85 < | (4 =) (1 move-h) (5 =) (10 =) (6 =) (1 reph) (7 =) (9 =) (8 =) | >)
87 ;; A syllable without vowel signs but with a vowel modifier.
89 ("([CR]n?(HJ?[CR]n?)*)((A)|(a))(S)?(s)?"
90 < | (1 move-h) (7 =) (1 reph) (4 =) (6 =) (5 =) | >)
92 ;; No vowel signs, No vowel modifiers, but with a stress sign or an accent.
94 ("([CR]n?(HJ?[CR]n?)*)((S)|(s))"
95 < | (1 move-h) (5 =) (1 reph) (4 =) | >)
97 ;; No marks at all. Need further anylysis.
98 ("[CR]n?(HJ?[CR]n?)*(H(N|J)?)?"
101 ;; This combination is used in Marathi.
105 ;; A syllable starting with an independent vowel.
107 ("(V)(A)?(a)?(S)?(s)?"
108 < | (1 =) (5 =) (2 =) (4 =) (3 =) | >)
115 ;; Starting with an eyelash-RA, which remains there.
121 ;; Starting with a reph, which is removed.
136 (1 otf:deva=rphf+))))
149 ;; Ending with a Halant and a ZWJ.
151 (0 del-reph) (0 reph))
153 ;; Ending with a Halant and an optional ZWNJ. Add ZWNJ explicitly.
155 (1 move-h) (1 reph) (2 =) 0x200C)
157 ;; Ending with a consonant.
159 (0 move-h) (0 reph))))
163 ;; Apply GSUB features. If a syllable ends with a halant and a ZWNJ,
164 ;; render the final halant explicitly.
168 ;; Allow eyelash RA to appear at the beginning.
169 (" (RH)J([^ ]+)(H)N "
170 | (1 otf:deva=half+) (2 gsub) (3 =) |)
171 (" (m)?(RH)J([^ ]*) "
172 | (1 =) (2 otf:deva=half+) (3 gsub) |)
174 ;; Avoid applying 'blwf' and 'half' to the "RH" at the beginning;
176 | (1 =) (2 gsub) (3 =) |)
178 | (1 otf:deva=pres+) (2 gsub) |)
188 ;; Dispite Rule R5a (The Unicode Standard 5.0, p.305), we use the
189 ;; below form to depict the sequence "RHJ" at non-initial positions.
190 ;; This is to avoid interpreting the sequence "CHRHJ" as "CH" +
191 ;; "RHJ". It should be parsed as "CHR" + "HJ".
195 (1 otf:deva=nukt,akhn,blwf,half,vatu,pres+) (2 gsub))
197 otf:deva=nukt,akhn,blwf,half,vatu,pres+)))
201 ;; Apply other features.
206 (1 otf:deva=abvs,blws,psts,haln+abvm,blwm,dist))
211 ;; Copyright (C) 2003, 2004, 2007
212 ;; National Institute of Advanced Industrial Science and Technology (AIST)
213 ;; Registration Number H15PRO112
215 ;; This file is part of the m17n database; a sub-part of the m17n
218 ;; The m17n library is free software; you can redistribute it and/or
219 ;; modify it under the terms of the GNU Lesser General Public License
220 ;; as published by the Free Software Foundation; either version 2.1 of
221 ;; the License, or (at your option) any later version.
223 ;; The m17n library is distributed in the hope that it will be useful,
224 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
225 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
226 ;; Lesser General Public License for more details.
228 ;; You should have received a copy of the GNU Lesser General Public
229 ;; License along with the m17n library; if not, write to the Free
230 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
231 ;; Boston, MA 02110-1301, USA.