Fix forced-*-form patterns.
[m17n/m17n-db.git] / ARABIC-OTF.flt
1 ;; ARABIC-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> ARABIC-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  )
43
44 (generator
45  (0
46   (cond
47    (".*p.*"                             ; If a high hamza is found,
48     (cond
49      (".*n.*"                           ;   and a suppressor exists,
50       rmhamza *)                        ;   then remove the high hamza.
51      (0                                 ;   Otherwise, move the high
52       0x674 rmhamza *)))                ;   hamza to the beginning.
53    (0 = *)))                            ; If no high hamza, do nothing.
54
55  (rmhamza
56   (cond
57    ((0x0674)            )
58    ((0x0675)            0x0627)
59    ((0x0676)            0x0648)
60    ((0x0677)            0x06C7)
61    ((0x0678)            0x0649)
62    ("."                 =))))
63
64 ;; Step 1: ccmp
65
66 ;; (generator
67 ;;  (0
68 ;;   otf:arab=ccmp))
69
70 ;; Step 2: Initial, medial, or final.
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  (0xFEF5                ?R)
120  (0xFEF7                ?R)
121  (0xFEF9                ?R)
122  (0xFEFB                ?R)
123  (0x200C                ?U)
124  (0x200D                ?D)
125  )
126
127 (generator
128  (0
129   (cond
130    ("D.*"
131     (cond
132      ("(.)(T*)([DR].*)"
133       (1 otf:arab=init)
134       (2 = *)
135       (3 join))
136      ("(.)(T*)(.*)"                     ; == (D)(T*)(U.*)
137       (1 otf:arab=isol)
138       (2 = *)
139       (3 disjoin))))
140
141    ("([RU])(T*)(.*)"
142     (1 otf:arab=isol)
143     (2 = *)
144     (3 disjoin))
145
146    ("(T+)(.*)"
147     (1 = *)
148     (2 disjoin))))
149
150  (join
151   (cond
152    ("D.*"
153     (cond
154      ("(.)(T*)([DR].*)"
155       (1 otf:arab=medi)
156       (2 = *)
157       (3 join))
158      ("(.)(T*)(.*)"                     ; == (D)(T*)(U.*)
159       (1 otf:arab=fina)
160       (2 = *)
161       (3 disjoin))))
162
163    ("(.)(T*)(.*)"                       ; == (R)(T*)(.*)
164     (1 otf:arab=fina)
165     (2 = *)
166     (3 disjoin))))
167
168  (disjoin
169   (cond
170    ("D.*"
171     (cond
172      ("(.)(T*)([DR].*)"
173       (1 otf:arab=init)
174       (2 = *)
175       (3 join))
176      ("(.)(T*)(.*)"                     ; == (D)(T*)(U.*)
177       (1 otf:arab=isol)
178       (2 = *)
179       (3 disjoin))))
180
181    ("(.)(T*)(.*)"                       ; == ([RU])(T*)(.*)
182     (1 otf:arab=isol)
183     (2 = *)
184     (3 disjoin)))))
185
186 ;; Step 3: Other GSUB features (ligatures, etc.)
187
188 (generator
189  (0
190   otf:arab=rlig,calt,liga,dlig,cswh,mset))
191
192 ;; Step 4: GPOS features.
193
194 (generator
195  (0
196   otf:arab=))
197
198 ;; Local Variables:
199 ;; mode: lisp
200 ;; End: