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