1 ;; BENG-OTF.flt -- Font Layout Table for Bengali OpenType fonts
2 ;; Copyright (C) 2004, 2007, 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
5 (font layouter beng-otf nil
7 (font (nil nil unicode-bmp :otf=beng)))
11 ;;; For Bengali OpenType fonts to draw the Bengali script.
13 ;; After-base glyph order for rendering:
14 ;; 1. below form consonants
17 ;; 4. candrabindu (0981)
18 ;; 5. post form consonants
20 ;; 7. anusvara (0982) and visarga (0983)
24 ;; V: independent vowel
32 ;; m: vowel sign (pre)
33 ;; b: vowel sign (below)
34 ;; p: vowel sign (post)
35 ;; a: vowel modifier (above)
36 ;; A: vowel modifier (post)
39 (0x0980 0x09FF ?X) ; generic
40 (0x0981 ?a) ; SIGN CANDRABINDU
41 (0x0982 0x0983 ?A) ; SIGN ANUSVARA .. VISARGA
42 (0x0985 0x0994 ?V) ; LETTER A .. AU
43 (0x0995 0x09B9 ?C) ; LETTER KA .. HA
44 (0x09AC ?B) ; LETTER BA
45 (0x09AF ?Y) ; LETTER YA
46 (0x09B0 ?R) ; LETTER RA
47 (0x09BC ?n) ; SIGN NUKTA
48 (0x09BE ?p) ; VOWEL SIGN AA
49 (0x09BF ?m) ; VOWEL SIGN I
50 (0x09C0 ?p) ; VOWEL SIGN II
51 (0x09C1 0x09C4 ?b) ; VOWEL SIGN U .. RR
52 (0x09C7 0x09C8 ?m) ; VOWEL SIGN E .. AI
53 (0x09CD ?H) ; SIGN VIRAMA
54 (0x09CE ?T) ; LETTER KHANDA TA
55 (0x09D7 ?p) ; AU LENGTH MARK
56 (0x09DC 0x09DF ?C) ; LETTER RRA .. YYA
57 (0x09E0 0x09E1 ?V) ; LETTER VOCALIC RR, LL
58 (0x09E2 0x09E3 ?b) ; VOWEL SIGN L .. LL
59 (0x09F0 ?R) ; LETTER RA WITH MIDDLE DIAGONAL
60 (0x09F1 ?C) ; LETTER RA WITH LOWER DIAGONAL
64 (0x25CC ?X) ; DOTTED CIRCLE
75 ;; Decompose two-part vowel signs.
81 ;; TA + HALANT + ZWJ -> KHANDA-TA
82 ((0x09A4 0x09CD 0x200D)
97 ;; Syllable identification
101 ;; Syllables with an independent vowel
102 ("(RH)?(Vn?)((J?H[BYR])?m?b?p?n?a?A?)"
103 < | (1 = =) (2 :otf=beng=nukt+) (3 = *) | >)
105 ;; KHANDA-TA combines only with reph.
107 < (2 =) (1 :otf=beng=rphf+) >)
109 ;; Consonant-based syllables
111 ("([CBYR]n?((J?H|HJ?)[CBYR]n?)*)(H[NJ]?|m?([NJ]?b)?p?n?a?A?)"
112 < | (1 :otf=beng=nukt,akhn+)
114 ("(H)N?" (1 =) 0x200C)
117 ;; Two-part vowel signs
120 ((font-facility 0x25CC) < 0x09C7 0x25CC 0x09BE >)
124 ((font-facility 0x25CC) < 0x09C7 0x25CC 0x09D7 >)
127 ;; Combining marks are displayed with a DOTTED CIRCLE.
130 ((font-facility 0x25CC) < = 0x25CC >)
134 ((font-facility 0x25CC) < 0x25CC = >)
137 ;; Isolated blwf and pstf are displayed with a DOTTED CIRCLE in the
140 < | (1 =) (3 =) (2 =) | >)
146 ;; Reorder halant for blwf and pstf
150 ;; Isolated blwf and pstf
153 ((font-facility 0x25CC) < 0x25CC (1 :otf=beng=blwf,pstf+) >)
154 (" J([BYR]H) " [ (1 :otf=beng=blwf,pstf+) ])))
156 ;; Syllables with an overt halant
157 (" (RHJ?)?([^ ]+)(HN) "
158 | (1 = *) (2 reorder) (3 = =) |)
160 ;; Ordinary syllables
161 (" (RHJ?)?([^mbpaA ]*[^mbpaANJ ])(m?([NJ]?b)?p?n?a?A?) "
162 | (1 = *) (2 reorder) (3 = *) |)
168 ("(.|.+[^YJ])((J?HY)*)$"
169 (1 reorder-BR) (2 reorder-Y)))
171 ;; Unlike Devanagari and Gujarati, vattu in Bengali does not have a
172 ;; half form. Therefore the sequence CHRHC can be safely reordered
173 ;; as CRHHC. Same for CHBHC.
177 (2 =) (1 =) (3 reorder-BR))
179 (1 =) (2 reorder-BR))))
183 (2 =) (1 =) (3 reorder-Y)))
187 ;; Language forms and matra reordering
191 ;; Overt halant forms
192 (" (RHJ?)?([^ ]+)(HN) "
194 (1 (cond ("RHJ" :otf=beng=half+)
195 ("RH" :otf=beng=rphf+)))
196 (2 b4post) (2 post) (3 = =) |)
198 ;; Syllables with a below matra
200 (" (RHJ?)?([^mb]*[^mbNJ])(mn?)?([NJ]?bn?)(p?n?a?A?) "
202 (1 (cond ("RHJ" :otf=beng=half+)
203 ("RH" :otf=beng=rphf+)))
204 (2 b4post) (4 = *) (2 post) (5 = *) |)
208 (" (RHJ?)?([^mpaA ]*)(mn?)?(p?n?a?A?) "
210 (1 (cond ("RHJ" :otf=beng=half+)
211 ("RH" :otf=beng=rphf+)))
212 (2 b4post) (2 post) (4 = *) |)
217 ;; FIXME: When the constant C has both half and blwf, the partial
218 ;; sequence CHJ changes into blwf, instead of half, unless it is
219 ;; placed at the beginning of a syllable.
221 ("(.|.+[^YH]H?)(YH)*$"
222 (1 (cond ("(.H)(.+)" (1 :otf=beng=half+) (2 :otf=beng=blwf,half,vatu+))
223 (".+" :otf=beng=blwf,half,vatu+)))))
226 ("(.|.+[^YH]H?)((YH)+)$"
227 (2 :otf=beng=pstf+)))
231 ;; Final reordering #1 (Move pre-base matra after the last halant)
236 (" (mn?)([^ ]+HJ?)([^H ]+) "
237 | (2 = *) (1 = *) (3 = *) |)
243 ;; Final reordering #2 (Move reph after the first halant)
247 ;; Syllables with a reph and an explicit halant
249 (" (mn?)?(r)([^HP ]+HJ?)([^ ]*) "
250 | (1 = *) (3 = *) (2 =) (4 = *) |)
252 ;; A reph without explicit halant
254 (" (mn?)?(r)([^PpaA ]+)(P*(HN)?p?n?a?A?) "
255 | (1 = *) (3 = *) (2 =) (4 = *) |)
261 ;; Nukta for matra and Presentation forms
266 | (1 :otf=beng=nukt,init+) (2 :otf=beng=nukt,pres,abvs,blws,psts,haln+) |)
287 (1 :otf=beng=+abvm,blwm,dist))
292 ;; Copyright (C) 2004, 2007, 2010
293 ;; National Institute of Advanced Industrial Science and Technology (AIST)
294 ;; Registration Number H15PRO112
296 ;; This file is part of the m17n database; a sub-part of the m17n
299 ;; The m17n library is free software; you can redistribute it and/or
300 ;; modify it under the terms of the GNU Lesser General Public License
301 ;; as published by the Free Software Foundation; either version 2.1 of
302 ;; the License, or (at your option) any later version.
304 ;; The m17n library is distributed in the hope that it will be useful,
305 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
306 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
307 ;; Lesser General Public License for more details.
309 ;; You should have received a copy of the GNU Lesser General Public
310 ;; License along with the m17n library; if not, write to the Free
311 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
312 ;; Boston, MA 02110-1301, USA.