1 ;; BNG2-OTF.flt -- Font Layout Table for bng2 OpenType fonts
2 ;; Copyright (C) 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
5 (font layouter bng2-otf nil
7 (font (nil nil unicode-bmp :otf=bng2)))
11 ;;; For bng2 OpenType fonts to draw the Bengali script.
13 ;; It seems that "Shornar Bangla.ttf" is designed to render the bng2
14 ;; script with the following glyph sequence.
16 ;; 2. half forms and below forms
19 ;; 5. below matra (09C1..09C4)
22 ;; 8. post matra (09C0, 09D7)
23 ;; 9. candrabindu (0981)
24 ;; 10. anusvara (0982) or visarga (0983)
28 ;; V: independent vowel
34 ;; m: vowel sign (pre)
35 ;; b: vowel sign (below)
36 ;; p: vowel sign (post)
37 ;; a: vowel modifier (above)
38 ;; A: vowel modifier (post)
41 (0x0980 0x09FF ?X) ; generic
42 (0x0981 ?a) ; SIGN CANDRABINDU
43 (0x0982 0x0983 ?A) ; SIGN ANUSVARA .. VISARGA
44 (0x0985 0x0994 ?V) ; LETTER A .. AU
45 (0x0995 0x09B9 ?C) ; LETTER KA .. HA
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[CR])?m?b?p?n?a?A?"
105 ;; KHANDA-TA combines only with reph.
107 < (2 =) (1 :otf=bng2=rphf+) >)
109 ;; Consonant-based syllables
110 ("([CR]n?J?HJ?)*[CR]n?(H[NJ]?|m?([NJ]?b)?p?n?)a?A?"
113 ;; Combining marks are displayed with a DOTTED CIRCLE.
114 ("n|H|b|p|a|A|JH[CR]"
115 < 0x25CC (0 :otf=bng2=blwf,pstf+) >)
119 < (1 =) 0x25CC (2 =) >)
125 ;; Basic shaping forms and matra reordering
129 ;; Explicit halant form starting with RA + H + ZWJ
130 (" (RHJ[CRnHJ]+)(HN?a?A?) "
131 (1 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
132 | (1 b4post) (1 post) (2 = *) |)
134 ;; Explicit halant form starting with a reph
135 (" (RH)([CRnHJ]+)(HN?a?A?) "
136 (2 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
137 | (1 :otf=bng2=rphf+) (2 b4post) (2 post) (3 = *) |)
139 ;; Other explicit halant forms
140 (" ([CRnHJ]+)(HN?a?A?) "
141 (1 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
142 | (1 b4post) (1 post) (2 = *) |)
144 ;; Ordinary syllables starting with RA + H + ZWJ
146 (" (RHJ[CRnHJN]*)(mn?)?(bn?)?((pn?)?a?A?) "
148 ;; This is an asterisk. (See DEV2-OTF.flt)
149 (1 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
150 | (2 = *) (1 b4post) (3 = *) (1 post) (4 = *) |)
152 ;; Ordinary syllables starting with a reph
154 (" (RH)([CRnHJVN]+)(mn?)?(bn?)?((pn?)?a?A?) "
155 (2 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
156 | (3 = *) (1 :otf=bng2=rphf+) (2 b4post) (4 = *) (2 post) (5 = *) |)
158 ;; Other ordinary syllables
160 (" ([CRnHJVN]+)(mn?)?(bn?)?((pn?)?a?A?) "
161 (1 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
162 | (2 = *) (1 b4post) (3 = *) (1 post) (4 = *) |)
170 ("([CRnHJP]*[CRV]n?)((J?PP)+)([NJ])?$"
171 (1 :otf=bng2=locl,nukt,akhn,blwf,half,vatu,cjct+) (4 =))
173 (0 :otf=bng2=locl,nukt,akhn,blwf,half,vatu,cjct+) (4 =))))
177 ("[CRnHJP]*[CRV]n?((J?PP)+)([NJ])?$"
178 (1 :otf=bng2=pstf+))))
182 ;; Final reordering #1 (Move pre-base matra after the last halant)
187 (" (mn?)([^ ]+HJ?)([^H ]+) "
188 | (2 = *) (1 = *) (3 = *) |)
194 ;; Final reordering #2 (Move reph after the first halant)
198 ;; Syllables with a reph and an explicit halant
200 (" (mn?)?(r)([^HP ]+HJ?)([^ ]*) "
201 | (1 = *) (3 = *) (2 =) (4 = *) |)
203 ;; A reph without explicit halant
205 (" (mn?)?(r)([^PpaA ]+)(P*H?p?n?a?A?) "
206 | (1 = *) (3 = *) (2 =) (4 = *) |)
212 ;; Nukta for matra and Presentation forms
217 | (1 :otf=bng2=nukt,init+)
218 (2 :otf=bng2=nukt,pres,abvs,blws,psts,haln,calt+) |)
239 (1 :otf=bng2=+kern,dist,abvm,blwm))
244 ;; Copyright (C) 2010
245 ;; National Institute of Advanced Industrial Science and Technology (AIST)
246 ;; Registration Number H15PRO112
248 ;; This file is part of the m17n database; a sub-part of the m17n
251 ;; The m17n library is free software; you can redistribute it and/or
252 ;; modify it under the terms of the GNU Lesser General Public License
253 ;; as published by the Free Software Foundation; either version 2.1 of
254 ;; the License, or (at your option) any later version.
256 ;; The m17n library is distributed in the hope that it will be useful,
257 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
258 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
259 ;; Lesser General Public License for more details.
261 ;; You should have received a copy of the GNU Lesser General Public
262 ;; License along with the m17n library; if not, write to the Free
263 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
264 ;; Boston, MA 02110-1301, USA.