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 ;; Two-part vowel signs
116 ((font-facility 0x25CC) < 0x09C7 0x25CC 0x09BE >)
120 ((font-facility 0x25CC) < 0x09C7 0x25CC 0x09D7 >)
123 ;; Combining marks are displayed with a DOTTED CIRCLE.
126 ((font-facility 0x25CC) < = 0x25CC >)
130 ((font-facility 0x25CC) < 0x25CC = >)
134 ((font-facility 0x25CC) < 0x25CC :otf=bng2=blwf,pstf+ >)
135 (".+" [ :otf=bng2=blwf,pstf+ ])))
141 ;; Basic shaping forms and matra reordering
145 ;; Explicit halant form starting with RA + H + ZWJ
146 (" (RHJ[CRnHJ]+)(HN?a?A?) "
147 (1 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
148 | (1 b4post) (1 post) (2 = *) |)
150 ;; Explicit halant form starting with a reph
151 (" (RH)([CRnHJ]+)(HN?a?A?) "
152 (2 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
153 | (1 :otf=bng2=rphf+) (2 b4post) (2 post) (3 = *) |)
155 ;; Other explicit halant forms
156 (" ([CRnHJ]+)(HN?a?A?) "
157 (1 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
158 | (1 b4post) (1 post) (2 = *) |)
160 ;; Ordinary syllables starting with RA + H + ZWJ
162 (" (RHJ[CRnHJN]*)(mn?)?(bn?)?((pn?)?a?A?) "
164 ;; This is an asterisk. (See DEV2-OTF.flt)
165 (1 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
166 | (2 = *) (1 b4post) (3 = *) (1 post) (4 = *) |)
168 ;; Ordinary syllables starting with a reph
170 (" (RH)([CRnHJVN]+)(mn?)?(bn?)?((pn?)?a?A?) "
171 (2 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
172 | (3 = *) (1 :otf=bng2=rphf+) (2 b4post) (4 = *) (2 post) (5 = *) |)
174 ;; Other ordinary syllables
176 (" ([CRnHJVN]+)(mn?)?(bn?)?((pn?)?a?A?) "
177 (1 :otf?bng2=locl,nukt,akhn,blwf,pstf+)
178 | (2 = *) (1 b4post) (3 = *) (1 post) (4 = *) |)
186 ("([CRnHJP]*[CRV]n?)((J?PP)+)([NJ])?$"
187 (1 :otf=bng2=locl,nukt,akhn,blwf,half,vatu,cjct+) (4 =))
189 (0 :otf=bng2=locl,nukt,akhn,blwf,half,vatu,cjct+) (4 =))))
193 ("[CRnHJP]*[CRV]n?((J?PP)+)([NJ])?$"
194 (1 :otf=bng2=pstf+))))
198 ;; Final reordering #1 (Move pre-base matra after the last halant)
203 (" (mn?)([^ ]+HJ?)([^H ]+) "
204 | (2 = *) (1 = *) (3 = *) |)
210 ;; Final reordering #2 (Move reph after the first halant)
214 ;; Syllables with a reph and an explicit halant
216 (" (mn?)?(r)([^HP ]+HJ?)([^ ]*) "
217 | (1 = *) (3 = *) (2 =) (4 = *) |)
219 ;; A reph without explicit halant
221 (" (mn?)?(r)([^PpaA ]+)(P*H?p?n?a?A?) "
222 | (1 = *) (3 = *) (2 =) (4 = *) |)
228 ;; Nukta for matra and Presentation forms
233 | (1 :otf=bng2=nukt,init+)
234 (2 :otf=bng2=nukt,pres,abvs,blws,psts,haln,calt+) |)
255 (1 :otf=bng2=+kern,dist,abvm,blwm))
260 ;; Copyright (C) 2010
261 ;; National Institute of Advanced Industrial Science and Technology (AIST)
262 ;; Registration Number H15PRO112
264 ;; This file is part of the m17n database; a sub-part of the m17n
267 ;; The m17n library is free software; you can redistribute it and/or
268 ;; modify it under the terms of the GNU Lesser General Public License
269 ;; as published by the Free Software Foundation; either version 2.1 of
270 ;; the License, or (at your option) any later version.
272 ;; The m17n library is distributed in the hope that it will be useful,
273 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
274 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
275 ;; Lesser General Public License for more details.
277 ;; You should have received a copy of the GNU Lesser General Public
278 ;; License along with the m17n library; if not, write to the Free
279 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
280 ;; Boston, MA 02110-1301, USA.