Include syllable final HJ to otf part.
[m17n/m17n-db.git] / FLT / ARAB-OTF-NO-GPOS.flt
1 ;; ARAB-OTF-NO-GPOS.flt -- Font Layout Table for Arabic OpenType font sans GPOS
2 ;; Copyright (C) 2005, 2006, 2007, 2008  AIST (H15PRO112)
3 ;; See the end for copying conditions.
4
5 (font layouter arab-otf-no-gpos nil
6       (font (nil nil unicode-bmp :otf=arab=init,medi,fina,liga+~mark)))
7
8 ;;; <li> ARAB-OTF-NO-GPOS.flt
9 ;;;
10 ;;; For Arabic OpenType fonts that don't have GPOS table to draw the
11 ;;; Arabic script.
12
13 ;; Step 0: Move Kazakh high hamza.
14
15 (category
16  ;; p: high hamza carrier (p for positive)
17  ;; n: high hamza suppressor (n for negative)
18  ;; x: don't care
19  ;; X: presentation form
20  (0x0600 0x06FF         ?x)
21  (0x0674 0x0678         ?p)
22  (0x0643                ?n)
23  (0x06AF                ?n)
24  (0x06D5                ?n)
25  (0x0750 0x077F         ?x)             ; Arabic Supplement
26  (0x200C                ?x)
27  (0x200D                ?x)
28  (0x25CC                ?x)
29  (0xFB50 0xFDFF         ?X)             ; Arabic Presentation Forms-A
30  (0xFE70 0xFEFC         ?X)             ; Arabic Presentation Forms-B
31  )
32
33 (generator
34  (0
35   (cond
36    ;; If a presentation form is found, draw the whole sequence as is.
37    (".*X.*" = *)
38
39    (".*p.*"                             ; If a high hamza is found,
40     (cond
41      (".*n.*"                           ;   and a suppressor exists,
42       rmhamza *)                        ;   then remove the high hamza.
43      (0                                 ;   Otherwise, move the high
44       0x674 rmhamza *)))                ;   hamza to the beginning.
45    (0 = *)))                            ; If no high hamza, do nothing.
46
47  (rmhamza
48   (cond
49    ((0x0674)            )
50    ((0x0675)            0x0627)
51    ((0x0676)            0x0648)
52    ((0x0677)            0x06C7)
53    ((0x0678)            0x0649)
54    ("."                 =))))
55
56 ;; Step 1: ccmp
57
58 (category
59  ;; D: Dual-joining (beh, teh, etc. & zwj)
60  ;; R: Right-joining (alef, dal, thal, reh, zain)
61  ;; U: Non-joining (Hamza, etc. & zwnj)
62  ;; T: Transparent (combining marks)
63  (0x060B 0x060F         ?U)
64  (0x0610 0x0615         ?T)
65  (0x061B                ?U)
66  (0x061E 0x061F         ?U)
67  (0x0621                ?U)
68  (0x0622 0x0623         ?R)
69  (0x0624                ?R)
70  (0x0625                ?R)
71  (0x0626                ?D)
72  (0x0627                ?R)
73  (0x0628                ?D)
74  (0x0629                ?R)
75  (0x062A 0x062E         ?D)
76  (0x062F 0x0632         ?R)
77  (0x0633 0x0647         ?D)
78  (0x0648                ?R)
79  (0x0649 0x064A         ?D)
80  (0x064B 0x065E         ?T)
81  (0x0660 0x066D         ?U)
82  (0x066E 0x066F         ?D)
83  (0x0670                ?T)
84  (0x0671 0x0673         ?R)
85  (0x0674 0x0678         ?U)
86  (0x0679 0x0687         ?D)
87  (0x0688 0x0699         ?R)
88  (0x069A 0x06C3         ?D)
89  (0x06C4 0x06CB         ?R)
90  (0x06CC 0x06CE         ?D)
91  (0x06CF                ?R)
92  (0x06D0 0x06D3         ?D)
93  (0x06D4                ?U)
94  (0x06D5                ?R)
95  (0x06D6 0x06E4         ?T)
96  (0x06E5 0x06E6         ?U)
97  (0x06E7 0x06E8         ?T)
98  (0x06E9                ?U)
99  (0x06EA 0x06ED         ?T)
100  (0x06EE 0x06EF         ?R)
101  (0x06F0 0x06F9         ?U)
102  (0x06FA 0x06FC         ?D)
103  (0x06FD 0x06FE         ?U)
104  (0x06FF                ?D)
105  (0x0750 0x0758         ?D)
106  (0x0759 0x075B         ?R)
107  (0x075C 0x076A         ?D)
108  (0x076B 0x076C         ?R)
109  (0x076D 0x0770         ?D)
110  (0x0771                ?R)
111  (0x0772                ?D)
112  (0x0773 0x0774         ?R)
113  (0x0775 0x0777         ?D)
114  (0x0778 0x0779         ?R)
115  (0x077A 0x077F         ?D)
116  (0x200C                ?U)
117  (0x200D                ?D)
118  (0x25CC                ?U)
119  (0xFB50 0xFDFF         ?X)             ; Arabic Presentation Forms-A
120  (0xFE70 0xFEFC         ?X)             ; Arabic Presentation Forms-B
121  )
122
123 ;; (generator
124 ;;  (0
125 ;;   otf:arab=ccmp))
126
127 ;; Step 2: Initial, medial, or final.
128
129 (generator
130  (0
131   (cond
132    (".*X.*" (cond ("[DRUX]T*" < = * >) ("." =)) *)
133
134    ("D.*"
135     (cond
136      ("(.)(T*)([DR].*)"
137       <
138       (1 otf:arab=init)
139       (2 = *)
140       >
141       (3 join))
142      ("(.)(T*)(.*)"                     ; == (D)(T*)(U.*)
143       <
144       (1 otf:arab=isol)
145       (2 = *)
146       >
147       (3 disjoin))))
148
149    ("([RU])(T*)(.*)"
150     <
151     (1 otf:arab=isol)
152     (2 = *)
153     >
154     (3 disjoin))
155
156    ("(T+)(.*)"
157     (1 = *)
158     (2 disjoin))))
159
160  (join
161   (cond
162    ("D.*"
163     (cond
164      ("(.)(T*)([DR].*)"
165       <
166       (1 otf:arab=medi)
167       (2 = *)
168       >
169       (3 join))
170      ("(.)(T*)(.*)"                     ; == (D)(T*)(U.*)
171       <
172       (1 otf:arab=fina)
173       (2 = *)
174       >
175       (3 disjoin))))
176
177    ("(.)(T*)(.*)"
178     <
179     (1 otf:arab=fina)
180     (2 = *)
181     >
182     (3 disjoin))))
183
184  (disjoin
185   (cond
186    ("D.*"
187     (cond
188      ("(.)(T*)([DR].*)"
189       <
190       (1 otf:arab=init)
191       (2 = *)
192       >
193       (3 join))
194      ("(.)(T*)(.*)"                     ; == (D)(T*)(U.*)
195       <
196       (1 otf:arab=isol)
197       (2 = *)
198       >
199       (3 disjoin))))
200
201    ("(.)(T*)(.*)"                       ; == ([RU])(T*)(.*)
202     <
203     (1 otf:arab=isol)
204     (2 = *)
205     >
206     (3 disjoin)))))
207
208 ;; Step 3: GPOS features.
209
210 (generator
211  (0
212   (cond
213    ((0x0651 0x0650) tc+bc 0x064E tc+bc 0x0651) ; shadda + kasra
214    ((0x0651 0x064D) tc+bc 0x064B tc+bc 0x0651) ; shadda + kasratan
215    ((range 0x0610 0x0615) tc+bc =)
216    ((0x064B) tc+bc =)
217    ((0x064C) tc+bc =)
218    ((0x064D) bc-tc =)
219    ((0x064E) tc+bc =)
220    ((0x064F) tc+bc =)
221    ((0x0650) bc-tc =)
222    ((range 0x0651 0x0654) tc+bc =)
223    ((0x0655) bc-tc =)
224    ((0x0656) bc-tc =)
225    ((range 0x0657 0x065B) tc+bc =)
226    ((0x065C) bc-tc =)
227    ((0x065D) tc+bc =)
228    ((0x065E) tc+bc =)
229    ((0x0670) tc+bc =)
230    ((range 0x06D6 0x06DC) tc+bc =)
231    ((range 0x06DF 0x06E2) tc+bc =)
232    ((0x06E3) bc-tc =)
233    ((0x06E4) tc+bc =)
234    ((0x06E7) tc+bc =)
235    ((0x06E8) tc+bc =)
236    ((0x06EA) bc-tc =)
237    ((0x06EB) tc+bc =)
238    ((0x06EC) tc+bc =)
239    ((0x06ED) bc-tc =)
240    ((0x200C)    =)
241    ((0x200D)    =)
242    ("." =))
243   *))
244
245 ;; Copyright (C) 2005, 2006, 2007, 2008
246 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
247 ;;   Registration Number H15PRO112
248
249 ;; This file is part of the m17n database; a sub-part of the m17n
250 ;; library.
251
252 ;; The m17n library is free software; you can redistribute it and/or
253 ;; modify it under the terms of the GNU Lesser General Public License
254 ;; as published by the Free Software Foundation; either version 2.1 of
255 ;; the License, or (at your option) any later version.
256
257 ;; The m17n library is distributed in the hope that it will be useful,
258 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
259 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
260 ;; Lesser General Public License for more details.
261
262 ;; You should have received a copy of the GNU Lesser General Public
263 ;; License along with the m17n library; if not, write to the Free
264 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
265 ;; Boston, MA 02110-1301, USA.
266
267 ;; Local Variables:
268 ;; mode: lisp
269 ;; End: