1 ;; BENG-OTF.flt -- Font Layout Table for Bengali OpenType font
2 ;; Copyright (C) 2004, 2007
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H15PRO112
6 ;; This file is part of the m17n database; a sub-part of the m17n
9 ;; The m17n library is free software; you can redistribute it and/or
10 ;; modify it under the terms of the GNU Lesser General Public License
11 ;; as published by the Free Software Foundation; either version 2.1 of
12 ;; the License, or (at your option) any later version.
14 ;; The m17n library is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;; Lesser General Public License for more details.
19 ;; You should have received a copy of the GNU Lesser General Public
20 ;; License along with the m17n library; if not, write to the Free
21 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
26 ;;; For Bengali OpenType fonts to draw the Bengali script.
28 (font layouter beng-otf nil
29 (font (nil nil unicode-bmp :otf=beng=rphf)))
33 ;; V: independent vowel
34 ;; C: consonant (except for R, B and Y)
41 ;; m: vowel sign (pre)
42 ;; b: vowel sign (below)
43 ;; p: vowel sign (post)
44 ;; A: vowel modifier (above)
45 ;; a: vowel modifier (post)
47 ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
48 ;; J: ZWJ (ZERO WIDTH JOINER)
49 (0x0980 0x09FF ?X) ; generic
50 (0x0980 ?Z) ; internal use
51 (0x0981 ?A) ; SIGN CANDRABINDU
52 (0x0982 0x0983 ?a) ; SIGN ANUSVARA .. VISARGA
53 (0x0985 0x0994 ?V) ; LETTER A .. AU
54 (0x0995 0x09B9 ?C) ; LETTER KA .. HA
55 (0x09AC ?B) ; LETTER BA
56 (0x09AF ?Y) ; LETTER YA
57 (0x09B0 ?R) ; LETTER RA
58 (0x09BC ?n) ; SIGN NUKTA
59 (0x09BE ?p) ; VOWEL SIGN AA
60 (0x09BF ?m) ; VOWEL SIGN I
61 (0x09C0 ?p) ; VOWEL SIGN II
62 (0x09C1 0x09C4 ?b) ; VOWEL SIGN U .. RR
63 (0x09C7 0x09C8 ?m) ; VOWEL SIGN E .. AI
64 (0x09CD ?H) ; SIGN VIRAMA
65 (0x09CE ?T) ; LETTER KHANDA TA
66 (0x09D7 ?p) ; AU LENGTH MARK
67 (0x09DC 0x09DF ?C) ; LETTER RRA .. YYA
68 (0x09E0 0x09E1 ?V) ; LETTER VOCALIC RR, LL
69 (0x09E2 0x09E3 ?b) ; VOWEL SIGN L .. LL
70 (0x09F0 0x09F1 ?C) ; LETTER RR WITH MIDDLE/LOWER DIAGONAL
71 (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
80 ;; Decompose two-part vowel signs.
85 ;; TA + HALANT + ZWJ -> KHANDA-TA
86 ((0x09A4 0x09CD 0x200D)
98 ;; Syllable identification and reordering.
104 < | (2 =) (1 otf:beng=rphf+) | >)
106 ;; Standalone Ya-phalaa
110 ;; A syllable with a pre-base vowel sign.
112 ("(RH)?([CRBY]n?(HCn?)*(H[RB])?(J?HY)?)(m)(p)?(A)?(a)?"
113 < | (6 =) (2 pre-below) (1 otf:beng=rphf+) (8 =) (2 post) (7 =) (9 =) | >)
115 ;; A syllable with a non-pre-base vowel sign.
116 ;;1 2 3 4 5 6 78 9 10 11
117 ("(RH)?([CRBY]n?(HCn?)*(H[RB])?(J?HY)?)(N)?J?((b)|(p))(A)?(a)?"
118 < | (6 =) (2 pre-below) (8 =) (1 otf:beng=rphf+) (10 =)
119 (2 post) (9 =) (11 =) | >)
121 ;; A syllable with a vowel modifier and no vowel signs.
123 ("(RH)?([CRBY]n?(HCn?)*(H[RB])?(J?HY)?)((A)|(a))"
124 < | (2 pre-below) (1 otf:beng=rphf+) (7 =) (2 post) (8 =) | >)
126 ;; A syllable ending with a halant.
128 ("(RH)?([CRBY]n?(HCn?)*(H[RB])?(J?HY)?)(HN?)?"
129 < | (2 pre-below) (6 =) (1 otf:beng=rphf+) (2 post) | >)
131 ;; A syllable starting with an independent vowel.
134 < | (1 =) 0x0980 (2 post) (3 = *) | >)
139 ;; Move a halant after the base consonant to the end.
140 ;; Put a special mark after the final belew-base consonant.
141 ;; Remove post-base parts.
144 ("(.+)(H)([RB])(J?HY)?$"
145 (1 = *) (3 =) (2 =) 0x0980)
151 ;; Extract post-base parts and add a halant at the end.
152 ;; Produce nothing if there are no post-base parts.
160 ;; Apply 'nukt' and 'akhn'.
165 | (1 otf:beng=nukt,akhn+) (2 = *) |)
169 ;; Apply 'blwf' and 'pstf' to the concerning parts.
173 (" (N?m?.)([^Z]*)(Z)([^ ]*) "
174 | (1 = *) (2 otf:beng=blwf+) (3 =) (4 otf:beng=pstf+) |)
176 | (1 otf:beng=pstf+) |)
180 ;; Get pre-base and below-base conjuncts.
184 (" (N?m?)([^Z]+)(Z)([^ ]*) "
185 | (1 = *) (2 otf:beng=half,vatu,pres,blws+) (3 =) (4 = *) |)
189 ;; When the number of glyphs between a pre-base vowel sign and the
190 ;; post-below mark is more than one, move the pre-base vowel sign
191 ;; before the final glyph.
195 (" (N)?(m)([^Z]+)([^Z])Z([^ ]*) "
196 | (1 =) (3 = *) (2 =) (4 =) (5 = *) |)
202 ;; Get matra conjuncts.
203 ;; Do not apply 'blws' to syllables that begins with ZWNJ.
208 (1 otf:beng=init,pres,abvs,psts,haln+abvm,blwm,dist))
210 (1 otf:beng=init,pres,abvs,blws,psts,haln+abvm,blwm,dist))