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 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 / accent (below)
44 ;; V: independent vowel
48 (0x0900 0x097F ?X) ; generic
49 (0x0901 0x0902 ?A) ; SIGN CANDRABINDU .. ANUSVARA
50 (0x0903 ?a) ; SIGN VISARGA
51 (0x0904 0x0914 ?V) ; LETTER SHORT A .. AU
52 (0x0915 0x0939 ?C) ; LETTER KA .. HA
53 (0x0930 ?R) ; LETTER RA
54 (0x093C ?n) ; SIGN NUKTA
55 (0x093E ?p) ; VOWEL SIGN AA
56 (0x093F ?m) ; VOWEL SIGN I
57 (0x0940 ?p) ; VOWEL SIGN II
58 (0x0941 0x0944 ?b) ; VOWEL SIGN UU .. VOCALIC RR
59 (0x0945 0x0948 ?u) ; VOWEL SIGN CANDRA E .. AI
60 (0x0949 0x094C ?p) ; VOWEL SIGN CANDRA O .. AU
61 (0x094D ?H) ; SIGN VIRAMA
62 (0x0951 ?S) ; STRESS SIGN UDATTA
63 (0x0952 ?s) ; STRESS SIGN ANUDATTA
64 (0x0953 0x0954 ?S) ; GRAVE ACCENT .. ACUTE ACCENT
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 (0x097B 0x097C ?C) ; LETTER GGA .. JJA
69 (0x097E 0x097F ?C) ; LETTER DDDA .. BBA
74 ;; Compose consonant and nukta
78 ((0x0928 0x093C) 0x0929)
79 ((0x0930 0x093C) 0x0931)
80 ((0x0933 0x093C) 0x0934)
81 ((0x0915 0x093C) 0x0958)
82 ((0x0916 0x093C) 0x0959)
83 ((0x0917 0x093C) 0x095A)
84 ((0x091C 0x093C) 0x095B)
85 ((0x0921 0x093C) 0x095C)
86 ((0x0922 0x093C) 0x095D)
87 ((0x092B 0x093C) 0x095E)
88 ((0x092F 0x093C) 0x095F)
96 ;; A syllable containing a vowel sign.
97 ;;1 23 45 6 7 8 9 10 11
98 ("(RH)?(([CR]n?H)*[CR]n?)((m)|(b)|([up]))(A)?(a)?(S)?(s)?"
99 < | (5 =) (2 move-h) (6 =) (11 =) (7 =) (1 otf:deva=rphf+)
100 (8 =) (10 =) (9 =) | >)
102 ;; A syllable without vowel signs but with a vowel modifier.
104 ("(RH)?(([CR]n?H)*[CR]n?)((A)|(a))(S)?(s)?"
105 < | (2 move-h) (8 =) (1 otf:deva=rphf+) (5 =) (7 =) (6 =) | >)
107 ;; No vowel signs, No vowel modifiers, but with a stress sign or an accent.
109 ("(RH)?(([CR]n?H)*[CR]n?)((S)|(s))"
110 < | (2 move-h) (6 =) (1 otf:deva=rphf+) (5 =) | >)
112 ;; A special case: eyelash RA
114 < (1 otf:deva=half+) >)
116 ;; Forced half form. Do not move halant.
118 ("(RH)?(([CR]n?H)+)J"
119 < | (2 = *) (1 otf:deva=rphf+) | >)
121 ;; When a syllable ends with a halant, add a ZWNJ explicitly.
123 ("(RH)?(([CR]n?H)*[CR]n?)(H)?N?"
124 < | (2 move-h) (1 otf:deva=rphf+) (4 = 0x200C) | >)
126 ;; A syllable starting with an independent vowel.
128 ("(V)(A)?(a)?(S)?(s)?"
129 < | (1 =) (5 =) (2 =) (4 =) (3 =) | >)
141 ;; If a syllable ends with a halant and a ZWNJ, render the final
142 ;; halant explicitly. Do not apply 'blwf' nor 'half' to the initial
148 | (1 =) (2 gsub1) (3 =) |)
150 | (1 = *) (2 gsub1) (3 = *) |)
159 otf:deva=nukt,akhn,blwf,half,vatu,pres+))
161 ;; Apply other features. The 'pres' feature is applied again for
162 ;; pre-base vowel sign.
167 (1 otf:deva=pres,abvs,blws,psts,haln+abvm,blwm,dist))