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