1 ;; BENG-OTF.flt -- Font Layout Table for Bengali OpenType font
2 ;; Copyright (C) 2004, 2007 AIST (H15PRO112)
3 ;; See the end for copying conditions.
5 (font layouter beng-otf nil
6 (font (nil nil unicode-bmp :otf=beng=rphf)))
10 ;;; For Bengali OpenType fonts to draw the Bengali script.
14 ;; V: independent vowel
15 ;; C: consonant (except for R, B and Y)
22 ;; m: vowel sign (pre)
23 ;; b: vowel sign (below)
24 ;; p: vowel sign (post)
25 ;; A: vowel modifier (above)
26 ;; a: vowel modifier (post)
28 ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
29 ;; J: ZWJ (ZERO WIDTH JOINER)
30 (0x0980 0x09FF ?X) ; generic
31 (0x0980 ?Z) ; internal use
32 (0x0981 ?A) ; SIGN CANDRABINDU
33 (0x0982 0x0983 ?a) ; SIGN ANUSVARA .. VISARGA
34 (0x0985 0x0994 ?V) ; LETTER A .. AU
35 (0x0995 0x09B9 ?C) ; LETTER KA .. HA
36 (0x09AC ?B) ; LETTER BA
37 (0x09AF ?Y) ; LETTER YA
38 (0x09B0 ?R) ; LETTER RA
39 (0x09BC ?n) ; SIGN NUKTA
40 (0x09BE ?p) ; VOWEL SIGN AA
41 (0x09BF ?m) ; VOWEL SIGN I
42 (0x09C0 ?p) ; VOWEL SIGN II
43 (0x09C1 0x09C4 ?b) ; VOWEL SIGN U .. RR
44 (0x09C7 0x09C8 ?m) ; VOWEL SIGN E .. AI
45 (0x09CD ?H) ; SIGN VIRAMA
46 (0x09CE ?T) ; LETTER KHANDA TA
47 (0x09D7 ?p) ; AU LENGTH MARK
48 (0x09DC 0x09DF ?C) ; LETTER RRA .. YYA
49 (0x09E0 0x09E1 ?V) ; LETTER VOCALIC RR, LL
50 (0x09E2 0x09E3 ?b) ; VOWEL SIGN L .. LL
51 (0x09F0 0x09F1 ?C) ; LETTER RR WITH MIDDLE/LOWER DIAGONAL
52 (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
61 ;; Decompose two-part vowel signs.
66 ;; TA + HALANT + ZWJ -> KHANDA-TA
67 ((0x09A4 0x09CD 0x200D)
79 ;; Syllable identification and reordering.
85 < | (2 =) (1 otf:beng=rphf+) | >)
87 ;; A syllable with a pre-base vowel sign.
89 ("(RH)?([CRBY]n?(HCn?)*(H[RB])?(J?HY)?)(m)(p)?(A)?(a)?"
90 < | (6 =) (2 pre-below) (1 otf:beng=rphf+) (8 =) (2 post) (7 =) (9 =) | >)
92 ;; A syllable with a non-pre-base vowel sign.
93 ;;1 2 3 4 5 6 78 9 10 11
94 ("(RH)?([CRBY]n?(HCn?)*(H[RB])?(J?HY)?)(N)?J?((b)|(p))(A)?(a)?"
95 < | (6 =) (2 pre-below) (8 =) (1 otf:beng=rphf+) (10 =)
96 (2 post) (9 =) (11 =) | >)
98 ;; A syllable with a vowel modifier and no vowel signs.
100 ("(RH)?([CRBY]n?(HCn?)*(H[RB])?(J?HY)?)((A)|(a))"
101 < | (2 pre-below) (1 otf:beng=rphf+) (7 =) (2 post) (8 =) | >)
103 ;; A syllable ending with a halant.
105 ("(RH)?([CRBY]n?(HCn?)*(H[RB])?(J?HY)?)(HN?)?"
106 < | (2 pre-below) (6 =) (1 otf:beng=rphf+) (2 post) | >)
108 ;; A syllable starting with an independent vowel.
110 ("(V)(J?(H)(Y)(p))?(A?a?)"
111 < | (1 =) 0x0980 (4 =) (3 =) (5 =) (6 = *) | >)
116 ;; Move a halant after the base consonant to the end.
117 ;; Put a special mark after the final belew-base consonant.
118 ;; Remove post-base parts.
121 ("(.+)(H)([RB])(J?HY)?$"
122 (1 = *) (3 =) (2 =) 0x0980)
128 ;; Extract post-base parts and add a halant at the end.
129 ;; Produce nothing if there are no post-base parts.
135 ;; Apply 'nukt' and 'akhn'.
140 | (1 otf:beng=nukt,akhn+) (2 = *) |)
144 ;; Apply 'blwf' and 'pstf' to the concerning parts.
148 (" (N?m?.)([^Z]*)(Z)([^ ]*) "
149 | (1 = *) (2 otf:beng=blwf+) (3 =) (4 otf:beng=pstf+) |)
153 ;; Get pre-base and below-base conjuncts.
157 (" (N?m?)([^Z]+)(Z)([^ ]*) "
158 | (1 = *) (2 otf:beng=half,vatu,pres,blws+) (3 =) (4 = *) |)
162 ;; When the number of glyphs between a pre-base vowel sign and the
163 ;; post-below mark is more than one, move the pre-base vowel sign
164 ;; before the final glyph.
168 (" (N)?(m)([^Z]+)([^Z])Z([^ ]*) "
169 | (1 =) (3 = *) (2 =) (4 =) (5 = *) |)
175 ;; Get matra conjuncts.
176 ;; Do not apply 'blws' to syllables that begins with ZWNJ.
181 (1 otf:beng=init,pres,abvs,psts,haln+abvm,blwm,dist))
183 (1 otf:beng=init,pres,abvs,blws,psts,haln+abvm,blwm,dist))
188 ;; Copyright (C) 2004, 2007
189 ;; National Institute of Advanced Industrial Science and Technology (AIST)
190 ;; Registration Number H15PRO112
192 ;; This file is part of the m17n database; a sub-part of the m17n
195 ;; The m17n library is free software; you can redistribute it and/or
196 ;; modify it under the terms of the GNU Lesser General Public License
197 ;; as published by the Free Software Foundation; either version 2.1 of
198 ;; the License, or (at your option) any later version.
200 ;; The m17n library is distributed in the hope that it will be useful,
201 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
202 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
203 ;; Lesser General Public License for more details.
205 ;; You should have received a copy of the GNU Lesser General Public
206 ;; License along with the m17n library; if not, write to the Free
207 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
208 ;; Boston, MA 02110-1301, USA.