1 ;; DEV-OTF.flt -- Font Layout Table for Devanagari OpenType font
2 ;; Copyright (C) 2003, 2004
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., 59 Temple Place, Suite 330, Boston, MA
26 ;;; For Devanagari OpenType fonts to draw the Devanagari script.
29 ;; C: consonant (except for R)
37 ;; A: vowel modifier (above)
38 ;; a: vowel modifier (post)
39 ;; S: stress sign (above)
40 ;; s: stress sign (below)
41 ;; V: independent vowel
42 ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
43 ;; J: ZWJ (ZERO WIDTH JOINER)
46 (#x0900 #x097F ?E) ; ELSE
47 (#x0901 ?A) ; SIGN CANDRABINDU (above)
48 (#x0902 ?A) ; SIGN ANUSVARA (above)
49 (#x0903 ?a) ; SIGN VISARGA (post)
50 (#x0905 #x0914 ?V) ; LETTER A .. LETTER AU
51 (#x0915 #x0939 ?C) ; LETTER KA .. LETTER HA
52 (#x0930 ?R) ; LETTER RA
53 (#x093C ?n) ; SIGN NUKTA
54 (#x093D ?E) ; SIGN AVAGRAHA
55 (#x093E #x094C ?p) ; VOWEL SIGN (post)
56 (#x093F ?m) ; VOWEL SIGN I (pre)
57 (#x0941 #x0944 ?b) ; VOWEL SIGN (below)
58 (#x0945 #x0948 ?u) ; VOWEL SIGN (above)
59 (#x094D ?H) ; SIGN VIRAMA (HALANT)
61 (#x0951 #x0954 ?S) ; STRESS SIGN or TONE MARK (above)
62 (#x0952 ?s) ; STRESS SIGN or TONE MARK (below)
63 (#x0958 #x095E ?C) ; LETTER QA .. LETTER YYA
64 (#x0960 ?V) ; LETTER VOCALIC RR
65 (#x0961 ?V) ; LETTER VOCALIC LL
66 (#x0962 #x0963 ?b) ; VOWEL SIGN (below)
67 (#x0964 #x0970 ?E) ; DANDA .. ABBREVIATION SIGN
70 (#x097D ?x) ; internally used tag to indicate Reph
71 (#x097E ?y) ; internally used tag to indicate Mpost
72 (#x097F ?z) ; internally used tag to indicate Cbase
75 ;; The first stage is to extract a syllable and re-order characters in
80 ;; If [CR]H is followed by ZWNJ/ZWJ, move ZWNJ/ZWJ to the head so
81 ;; that the later stages find it quickly.
83 < | (2 =) (1 = *) | > )
85 ;; A syllable starting with RH (Reph) and ending with a vowel
86 ;; and/or a vowel modifier.
87 ("(RH)(([CR]n?H)*[CR]n?)([mubp][Aa]?[Ss]?|[Aa][Ss]?|[Ss])"
88 < | (1 #x097D = =) (2 move-base-Halant) (4 reorder-post-base) | >)
90 ;; A syllable starting with RH (Reph) and ending without a vowel
91 ;; nor a vowel modifier.
92 ("(RH)(([CR]n?H)*[CR]n?)(H)?"
93 < | (1 #x097D = =) (2 move-base-Halant) (4 =) | >)
95 ;; A syllable starting with the other consonant and ending with a
96 ;; vowel and/or a vowel modifier.
97 ("(([CR]n?H)*[CR]n?)([mubp][Aa]?[Ss]?|[Aa][Ss]?|[Ss])"
98 < | (1 move-base-Halant) (3 reorder-post-base) | >)
100 ;; A syllable starting with the other consonant and ending without
101 ;; a vowel nor a vowel modifier.
102 ("(([CR]n?H)*[CR]n?)(H)?"
103 < | (1 move-base-Halant) (3 =) | >)
105 ;; A syllable starting with an independent vowel.
112 ;; Move Halant on a base consonant to the tail.
115 ("(([CR]n?H)*[CR]n?)(H)(R)"
122 ;; Re-order post modifiers.
124 ;; 12 3 4 5 67 8 9 10
125 ("((m)|(u)|(b)|(p))?((A)|(a))?((S)|(s))?$"
126 (2 =) (4 =) (10 =) (3 =) (5 =)
130 ;; The second stage is to reorder Reph and Mpre.
136 (" (x(..))([CRnH]*) "
137 | (3 = *) (2 otf:deva=rphf) |)
138 (" (x(..))([CRnH]*)(m?)([^y]*)y([^ ]*) "
139 | (4 =) (3 = *) (5 = *) (2 otf:deva=rphf) (6 = *) |)
142 (" ([CRnH][CRnH]*)(m?)([^y]*)y([^ ]*) "
143 | (2 =) (1 = *) (3 = *) (4 = *) |)
147 ;; The third stage is to drive OTF tables. For the moment, we use
148 ;; the default LangSys, and try all GSUB/GPOS features except for the
149 ;; sequence followed by ZWNJ in which case try "nukt" and "haln"
155 (1 otf:deva=nukt,haln))
161 (1 otf:deva=~rphf,*) (2 otf:deva=haln))
164 (1 otf:deva=~rphf,*))