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