Update FSF postal address.
[m17n/m17n-db.git] / ARAB-OTF.flt
1 ;; ARAB-OTF.flt -- Font Layout Table for Arabic OpenType font
2 ;; Copyright (C) 2004, 2006
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., 59 Temple Place, Suite 330, Boston, MA
22 ;; 02111-1307, USA.
23
24 ;;; <li> ARAB-OTF.flt
25 ;;;
26 ;;; For Arabic OpenType fonts to draw the Arabic script.
27
28
29 ;; Step 0: Move Kazakh high hamza.
30
31 (category
32  ;; p: high hamza carrier (p for positive)
33  ;; n: high hamza suppressor (n for negative)
34  ;; x: don't care
35  (0x0600 0x06FF         ?x)
36  (0x0750 0x077F         ?x)             ; Arabic Supplement
37  (0x0674 0x0678         ?p)
38  (0x0643                ?n)
39  (0x06AF                ?n)
40  (0x06D5                ?n)
41  (0x200C                ?x)
42  (0x200D                ?x)
43  (0x25CC                ?x)
44  (0xFB50 0xFDFF         ?X)             ; Arabic Presentation Froms-A
45  (0xFE70 0xFEFC         ?X)             ; Arabic Presentation Froms-B
46  )
47
48 (generator
49  (0
50   (cond
51    ;; If a presentation from is found, draw the whole sequence as is.
52    (".*X.*" = *)
53
54    (".*p.*"                             ; If a high hamza is found,
55     (cond
56      (".*n.*"                           ;   and a suppressor exists,
57       rmhamza *)                        ;   then remove the high hamza.
58      (0                                 ;   Otherwise, move the high
59       0x674 rmhamza *)))                ;   hamza to the beginning.
60    (0 = *)))                            ; If no high hamza, do nothing.
61
62  (rmhamza
63   (cond
64    ((0x0674)            )
65    ((0x0675)            0x0627)
66    ((0x0676)            0x0648)
67    ((0x0677)            0x06C7)
68    ((0x0678)            0x0649)
69    ("."                 =))))
70
71 ;; Step 1: ccmp
72
73 (category
74  ;; D: Dual-joining (beh, teh, etc. & zwj)
75  ;; R: Right-joining (alef, dal, thal, reh, zain)
76  ;; U: Non-joining (Hamza, etc. & zwnj)
77  ;; T: Transparent (combining marks)
78  (0x060B 0x060F         ?U)
79  (0x0610 0x0615         ?T)
80  (0x061B                ?U)
81  (0x061E 0x061F         ?U)
82  (0x0621                ?U)
83  (0x0622 0x0623         ?R)
84  (0x0624                ?R)
85  (0x0625                ?R)
86  (0x0626                ?D)
87  (0x0627                ?R)
88  (0x0628                ?D)
89  (0x0629                ?R)
90  (0x062A 0x062E         ?D)
91  (0x062F 0x0632         ?R)
92  (0x0633 0x0647         ?D)
93  (0x0648                ?R)
94  (0x0649 0x064A         ?D)
95  (0x064B 0x065E         ?T)
96  (0x0660 0x066D         ?U)
97  (0x066E 0x066F         ?D)
98  (0x0670                ?T)
99  (0x0671 0x0673         ?R)
100  (0x0674 0x0678         ?U)
101  (0x0679 0x0687         ?D)
102  (0x0688 0x0699         ?R)
103  (0x069A 0x06C3         ?D)
104  (0x06C4 0x06CB         ?R)
105  (0x06CC 0x06CE         ?D)
106  (0x06CF                ?R)
107  (0x06D0 0x06D3         ?D)
108  (0x06D4                ?U)
109  (0x06D5                ?R)
110  (0x06D6 0x06E4         ?T)
111  (0x06E5 0x06E6         ?U)
112  (0x06E7 0x06E8         ?T)
113  (0x06E9                ?U)
114  (0x06EA 0x06ED         ?T)
115  (0x06EE 0x06EF         ?R)
116  (0x06F0 0x06F9         ?U)
117  (0x06FA 0x06FC         ?D)
118  (0x06FD 0x06FE         ?U)
119  (0x06FF                ?D)
120  (0x0750 0x0758         ?D)
121  (0x0759 0x075B         ?R)
122  (0x075C 0x076A         ?D)
123  (0x076B 0x076C         ?R)
124  (0x076D                ?D)
125  (0x200C                ?U)
126  (0x200D                ?D)
127  (0x25CC                ?U)
128  (0xFB50 0xFDFF         ?X)             ; Arabic Presentation Froms-A
129  (0xFE70 0xFEFC         ?X)             ; Arabic Presentation Froms-B
130  )
131
132 ;; (generator
133 ;;  (0
134 ;;   otf:arab=ccmp))
135
136 ;; Step 2: Initial, medial, or final.
137
138 (generator
139  (0
140   (cond
141    (".*X.*" (cond ("[DRUX]T*" < = * >) ("." =)) *)
142
143    ("D.*"
144     (cond
145      ("(.)(T*)([DR].*)"
146       <
147       (1 otf:arab=init)
148       (2 = *)
149       >
150       (3 join))
151      ("(.)(T*)(.*)"                     ; == (D)(T*)(U.*)
152       <
153       (1 otf:arab=isol)
154       (2 = *)
155       >
156       (3 disjoin))))
157
158    ("([RU])(T*)(.*)"
159     <
160     (1 otf:arab=isol)
161     (2 = *)
162     >
163     (3 disjoin))
164
165    ("(T+)(.*)"
166     (1 = *)
167     (2 disjoin))))
168
169  (join
170   (cond
171    ("D.*"
172     (cond
173      ("(.)(T*)([DR].*)"
174       <
175       (1 otf:arab=medi)
176       (2 = *)
177       >
178       (3 join))
179      ("(.)(T*)(.*)"                     ; == (D)(T*)(U.*)
180       <
181       (1 otf:arab=fina)
182       (2 = *)
183       >
184       (3 disjoin))))
185
186    ("(.)(T*)(.*)"
187     <
188     (1 otf:arab=fina)
189     (2 = *)
190     >
191     (3 disjoin))))
192
193  (disjoin
194   (cond
195    ("D.*"
196     (cond
197      ("(.)(T*)([DR].*)"
198       <
199       (1 otf:arab=init)
200       (2 = *)
201       >
202       (3 join))
203      ("(.)(T*)(.*)"                     ; == (D)(T*)(U.*)
204       <
205       (1 otf:arab=isol)
206       (2 = *)
207       >
208       (3 disjoin))))
209
210    ("(.)(T*)(.*)"                       ; == ([RU])(T*)(.*)
211     <
212     (1 otf:arab=isol)
213     (2 = *)
214     >
215     (3 disjoin)))))
216
217 ;; Step 3: Other GSUB features (ligatures, etc.)
218
219 (generator
220  (0
221   otf:arab=rlig,calt,liga,dlig,cswh,mset))
222
223 ;; Step 4: GPOS features.
224
225 (generator
226  (0
227   otf:arab=))
228
229 ;; Local Variables:
230 ;; mode: lisp
231 ;; End: