1 ;; DEVA-OTF.flt -- Font Layout Table for Devanagari OpenType font
2 ;; Copyright (C) 2003, 2004, 2007
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H15PRO112
6 ;; This file is part of the m17n database; a sub-part of the m17n
9 ;; The m17n library is free software; you can redistribute it and/or
10 ;; modify it under the terms of the GNU Lesser General Public License
11 ;; as published by the Free Software Foundation; either version 2.1 of
12 ;; the License, or (at your option) any later version.
14 ;; The m17n library is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;; Lesser General Public License for more details.
19 ;; You should have received a copy of the GNU Lesser General Public
20 ;; License along with the m17n library; if not, write to the Free
21 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
26 ;;; For Devanagari OpenType fonts to draw the Devanagari script.
28 (font layouter deva-otf nil
29 (font (nil nil unicode-bmp :otf=deva=rphf)))
32 ;; C: consonant (except for R)
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 / accent (below)
44 ;; V: independent vowel
49 (0x0900 ?Z) ; internal use
50 (0x0901 0x097F ?X) ; generic
51 (0x0901 0x0902 ?A) ; SIGN CANDRABINDU .. ANUSVARA
52 (0x0903 ?a) ; SIGN VISARGA
53 (0x0904 0x0914 ?V) ; LETTER SHORT A .. AU
54 (0x0915 0x0939 ?C) ; LETTER KA .. HA
55 (0x0930 ?R) ; LETTER RA
56 (0x093C ?n) ; SIGN NUKTA
57 (0x093E ?p) ; VOWEL SIGN AA
58 (0x093F ?m) ; VOWEL SIGN I
59 (0x0940 ?p) ; VOWEL SIGN II
60 (0x0941 0x0944 ?b) ; VOWEL SIGN UU .. VOCALIC RR
61 (0x0945 0x0948 ?u) ; VOWEL SIGN CANDRA E .. AI
62 (0x0949 0x094C ?p) ; VOWEL SIGN CANDRA O .. AU
63 (0x094D ?H) ; SIGN VIRAMA
64 (0x0951 ?S) ; STRESS SIGN UDATTA
65 (0x0952 ?s) ; STRESS SIGN ANUDATTA
66 (0x0953 0x0954 ?S) ; GRAVE ACCENT .. ACUTE ACCENT
67 (0x0958 0x095F ?C) ; LETTER QA .. YYA
68 (0x0960 0x0961 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
69 (0x0962 0x0963 ?b) ; VOWEL SIGN VOCALIC L .. VOCALIC LL
70 (0x097B 0x097C ?C) ; LETTER GGA .. JJA
71 (0x097E 0x097F ?C) ; LETTER DDDA .. BBA
80 ;; A syllable containing a vowel sign.
81 ;;1 23 45 6 7 8 9 10 11
82 ("(RH)?(([CR]n?H)*[CR]n?)((m)|(b)|([up]))(A)?(a)?(S)?(s)?"
84 (5 =) (2 move-h) (6 =) (11 =) (7 =) (1 otf:deva=rphf+) (8 =) (10 =) (9 =)
87 ;; A syllable without vowel signs but with a vowel modifier.
89 ("(RH)?(([CR]n?H)*[CR]n?)((A)|(a))(S)?(s)?"
90 < | (2 move-h) (8 =) (1 otf:deva=rphf+) (5 =) (7 =) (6 =) | >)
92 ;; No vowel signs, No vowel modifiers, but with a stress sign or an accent.
94 ("(RH)?(([CR]n?H)*[CR]n?)((S)|(s))"
95 < | (2 move-h) (6 =) (1 otf:deva=rphf+) (5 =) | >)
97 ;; A special case: eyelash RA
99 < (1 otf:deva=half+) >)
101 ;; Forced half form. Do not move halant.
103 ("(RH)?(([CR]n?H)+)J"
104 < | (2 = *) (1 otf:deva=rphf+) | >)
106 ;; When a syllable ends with a halant, add a ZWNJ explicitly.
108 ("(RH)?(([CR]n?H)*[CR]n?)(H)?(N)?"
109 < | (2 move-h) (1 otf:deva=rphf+) (4 = 0x200C) | >)
111 ;; A syllable starting with an independent vowel.
113 ("(V)(A)?(a)?(S)?(s)?"
114 < | (1 =) (5 =) (2 =) (4 =) (3 =) | >)
119 ;; Move the halant that follows the base consonant to the end.
120 ;; Put a mark after the below form consonants.
124 ("(([CR]n?H)*Cn?)(H)((RH)*R)$"
125 (1 = *) (4 = *) (3 =) 0x0900)
128 (1 =) (3 = *) (2 =) 0x0900)
131 ;; If a syllable ends with a halant and a ZWNJ, render the final
132 ;; halant explicitly. Do not apply 'blwf' nor 'half' to the initial
137 (" (R)([^Z]*)(Z)([^ ]*)(H)N "
138 | (1 =) (2 gsub1) (3 =) (4 = *) (5 =) |)
139 (" (m?R)([^Z ]*)(Z)?([^ ]*) "
140 | (1 = *) (2 gsub1) (3 =) (4 = *) |)
141 (" ([^Z]+)(Z)([^ ]*)(H)N "
142 | (1 gsub1) (2 =) (3 * =) (4 =) |)
143 (" (m)?([^Z ]+)(Z)?([^ ]*) "
144 | (1 =) (2 gsub1) (3 =) (4 = *) |)
149 otf:deva=nukt,akhn,blwf,half,vatu,pres+))
151 ;; When the number of glyphs between a pre-base vowel sign and the
152 ;; post-below mark is more than one, move the pre-base vowel sign
153 ;; before the final glyph.
157 (" (m)([^Z]+)([^Z])Z([^ ]*) "
158 | (2 = *) (1 =) (3 =) (4 = *) |)
164 ;; Apply other features. The 'pres' feature is applied again for
165 ;; pre-base vowel sign.
170 (1 otf:deva=pres,abvs,blws,psts,haln))