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