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 ;; Many fonts still do not have KHANDA-TA.
84 ((font-facility 0x09CE) =)
85 (".+" 0x09A4 0x09CD 0x200D)))
99 ;; Syllable identification
103 ;; Syllables with an independent vowel
104 ("(RH)?(Vn?)((J?H[BYR])?m?b?p?n?a?A?)"
105 < | (1 = =) (2 :otf=beng=nukt+) (3 = *) | >)
107 ;; KHANDA-TA combines only with reph.
109 < (2 =) (1 :otf=beng=rphf+) >)
111 ;; Consonant-based syllables
113 ("([CBYR]n?((J?H|HJ?)[CBYR]n?)*)(H[NJ]?|m?([NJ]?b)?p?n?a?A?)"
116 (".+HJ$" :otf=beng=nukt,akhn+)
117 ("(.+)(H)N?$" (1 :otf=beng=nukt,akhn+) (2 =) 0x200C)
118 (".+" :otf=beng=nukt,akhn+))
121 ;; Two-part vowel signs
124 ((font-facility 0x25CC) < = 0x25CC = >)
128 ((font-facility 0x25CC) < = 0x25CC = >)
131 ;; Combining marks are displayed with a DOTTED CIRCLE.
134 ((font-facility 0x25CC) < = 0x25CC >)
138 ((font-facility 0x25CC) < 0x25CC = >)
141 ;; Isolated blwf and pstf are displayed with a DOTTED CIRCLE in the
144 < | (1 =) (3 =) (2 =) | >)
150 ;; Reorder halant for blwf and pstf
154 ;; Isolated blwf and pstf
157 ((font-facility 0x25CC) < 0x25CC (1 :otf=beng=blwf,pstf+) >)
158 (" J([BYR]H) " [ (1 :otf=beng=blwf,pstf+) ])))
160 ;; Syllables with an overt halant
161 (" (RHJ?)?([^ ]+)(HN) "
162 | (1 = *) (2 reorder) (3 = =) |)
164 ;; Syllables with a below matra
165 (" (RHJ?)?([^mbpaA ]*[^mbpaANJ ])(m?[NJ]?bp?n?a?A?) "
166 | (1 = *) (2 reorder) (3 = *) |)
169 (" (RHJ?)?([^mbpaA ]+)(m?p?n?a?A?) "
170 | (1 = *) (2 reorder) (3 = *) |)
176 ("(.|.+([^YJ]|JY|HJ))((J?HY)*)$"
177 (1 reorder-BR *) (3 reorder-Y *)))
179 ;; Unlike Devanagari and Gujarati, vattu in Bengali does not have a
180 ;; half form. Therefore the sequence CHRHC can be safely reordered
181 ;; to CRHHC. Same for CHBHC.
194 ;; Language forms and matra reordering
198 ;; Overt halant forms
199 (" (RHJ?)?([^ ]+)(HN) "
201 (1 (cond ("RHJ" :otf=beng=half+)
202 ("RH" :otf=beng=rphf+)))
203 (2 b4post) (2 post) (3 = =) |)
205 ;; Syllables with a below matra
207 (" (RHJ?)?([^mb]*[^mbNJ])(mn?)?([NJ]?bn?)(p?n?a?A?) "
209 (1 (cond ("RHJ" :otf=beng=half+)
210 ("RH" :otf=beng=rphf+)))
211 (2 b4post) (4 = *) (2 post) (5 = *) |)
215 (" (RHJ?)?([^mpaA ]*)(mn?)?(p?n?a?A?) "
217 (1 (cond ("RHJ" :otf=beng=half+)
218 ("RH" :otf=beng=rphf+)))
219 (2 b4post) (2 post) (4 = *) |)
228 (2 ("(.|.+([^YH]|JY|[BR]H))((YH)*)$" (1 lang-forms *))))
229 ("(.|.+([^YH]|JY|[BR]H))((YH)*)"
234 ("(.H)J" (1 :otf=beng=half+))
235 (".H" :otf=beng=blwf,half,vatu+)
239 ("(.|.+([^YH]|JY|[BR]H))((YH)+)$"
240 (3 :otf=beng=pstf+)))
244 ;; Final reordering #1 (Move pre-base matra after the last halant)
249 (" (mn?)([^ ]+HJ?)([^H ]+) "
250 | (2 = *) (1 = *) (3 = *) |)
256 ;; Final reordering #2 (Move reph after the first halant)
260 ;; Syllables with a reph and an explicit halant
262 (" (mn?)?(r)([^HP ]+HJ?)([^ ]*) "
263 | (1 = *) (3 = *) (2 =) (4 = *) |)
265 ;; A reph without explicit halant
267 (" (mn?)?(r)([^PpaA ]+)(P*(HN)?p?n?a?A?) "
268 | (1 = *) (3 = *) (2 =) (4 = *) |)
274 ;; Nukta for matra and Presentation forms
279 | (1 :otf=beng=nukt,init+) (2 :otf=beng=nukt,pres,abvs,blws,psts,haln+) |)
300 (1 :otf=beng=+abvm,blwm,dist))
305 ;; Copyright (C) 2004, 2007, 2010
306 ;; National Institute of Advanced Industrial Science and Technology (AIST)
307 ;; Registration Number H15PRO112
309 ;; This file is part of the m17n database; a sub-part of the m17n
312 ;; The m17n library is free software; you can redistribute it and/or
313 ;; modify it under the terms of the GNU Lesser General Public License
314 ;; as published by the Free Software Foundation; either version 2.1 of
315 ;; the License, or (at your option) any later version.
317 ;; The m17n library is distributed in the hope that it will be useful,
318 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
319 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
320 ;; Lesser General Public License for more details.
322 ;; You should have received a copy of the GNU Lesser General Public
323 ;; License along with the m17n library; if not, write to the Free
324 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
325 ;; Boston, MA 02110-1301, USA.