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
48 (#x0900 #x097F ?X) ; generic
49 (#x0901 ?A) ; SIGN CANDRABINDU
50 (#x0902 ?A) ; SIGN ANUSVARA
51 (#x0903 ?a) ; SIGN VISARGA
52 (#x0904 #x0914 ?V) ; LETTER SHORT A .. AU
53 (#x0915 #x0939 ?C) ; LETTER KA .. HA
54 (#x0930 ?R) ; LETTER RA
55 (#x093C ?n) ; SIGN NUKTA
56 (#x093E ?p) ; VOWEL SIGN AA
57 (#x093F ?m) ; VOWEL SIGN I
58 (#x0940 ?p) ; VOWEL SIGN II
59 (#x0941 #x0944 ?b) ; VOWEL SIGN UU .. VOCALIC RR
60 (#x0945 #x0948 ?u) ; VOWEL SIGN CANDRA E .. AI
61 (#x0949 #x094C ?p) ; VOWEL SIGN CANDRA O .. AU
62 (#x094D ?H) ; SIGN VIRAMA
63 (#x0951 ?S) ; STRESS SIGN UDATTA
64 (#x0952 ?s) ; STRESS SIGN ANUDATTA
65 (#x0953 #x0954 ?S) ; GRAVE ACCENT .. ACUTE ACCENT
66 (#x0958 #x095F ?C) ; LETTER QA .. YYA
67 (#x0960 #x0961 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
68 (#x0962 #x0963 ?b) ; VOWEL SIGN VOCALIC L .. VOCALIC LL
69 (#x097B #x097C ?C) ; LETTER GGA .. JJA
70 (#x097E #x097F ?C) ; LETTER DDDA .. BBA
79 ;; A syllable containing a vowel sign.
80 ;;1 23 45 6 7 89 A BC D
81 ("(RH)?(([CR]n?H)*[CR]n?)((m)|(b)|([up]))((A)|(a))?((S)|(s))?"
83 (5 =) (2 move-h) (6 =) (13 =) (7 =) (1 otf:deva=rphf+) (9 =) (12 =) (10 =)
86 ;; A syllable without vowel signs but with a vowel modifier.
88 ("(RH)?(([CR]n?H)*[CR]n?)((A)|(a))((S)|(s))?"
89 < | (2 move-h) (9 =) (1 otf:deva=rphf+) (5 =) (8 =) (6 =) | >)
91 ;; No vowel signs, No vowel modifiers, but with a stress sign or an accent.
93 ("(RH)?(([CR]n?H)*[CR]n?)((S)|(s))"
94 < | (2 move-h) (6 =)(1 otf:deva=rphf+) (5 =) | >)
98 < | (1 otf:deva=half+) | >)
100 ;; Forced half form. Do not move halant.
102 ("(RH)?(([CR]n?H)+)J"
103 < | (2 = *) (1 otf:deva=rphf+) | >)
105 ;; If a syllable ends with a halant, or a halant and a ZWNJ, mark
106 ;; this syllable for the special handling in the later stages.
108 ("(RH)?(([CR]n?H)*[CR]n?)(H)?(N)?"
109 < | (4 0x200C) (2 move-h) (1 otf:deva=rphf+) (4 =) | >)
111 ;; A syllable starting with an independent vowel.
113 ("(V)((A)|(a))?((S)|(s))?"
114 < | (1 =) (7 =) (3 =) (6 =) (4 =) | >)
119 ;; Move the halant that follows the base consonant to the end.
123 ("(([CR]n?H)*(Cn?))(H)((RH)*R)$"
124 (1 = *) (5 = *) (4 =))
131 ;; If a syllable is marked, render the final halant explicitly.
132 ;; Do not apply blwf nor half to the initial RA.
137 | (1 =) (2 gsub1) (3 =) |)
148 otf:deva=nukt,akhn,blwf,half,vatu+))
150 ;; Other OTF features
155 (1 otf:deva=pres,abvs,blws,psts,haln))