1 ;; ARAB-OTF-NO-GPOS.flt -- Font Layout Table for Arabic OpenType font sans GPOS
2 ;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
5 (font layouter arab-otf-no-gpos nil
6 (font (nil nil unicode-bmp :otf=arab=init,medi,fina+~mark)))
8 ;;; <li> ARAB-OTF-NO-GPOS.flt
10 ;;; For Arabic OpenType fonts that don't have GPOS table to draw the
13 ;; Step 0: Move Kazakh high hamza.
16 ;; p: high hamza carrier (p for positive)
17 ;; n: high hamza suppressor (n for negative)
19 ;; X: presentation form
25 (0x0750 0x077F ?x) ; Arabic Supplement
29 (0xFB50 0xFDFF ?X) ; Arabic Presentation Forms-A
30 (0xFE70 0xFEFC ?X) ; Arabic Presentation Forms-B
36 ;; If a presentation form is found, draw the whole sequence as is.
39 (".*p.*" ; If a high hamza is found,
41 (".*n.*" ; and a suppressor exists,
42 rmhamza *) ; then remove the high hamza.
43 (0 ; Otherwise, move the high
44 0x674 rmhamza *))) ; hamza to the beginning.
45 (0 = *))) ; If no high hamza, do nothing.
56 ;; Step 1: Initial, medial, or final. Surround diacritics by
60 ;; D: Dual-joining (beh, teh, etc. & zwj) except for LAMs
62 ;; R: Right-joining (alef, dal, thal, reh, zain) except for ALEFs
64 ;; U: Non-joining (Hamza, etc. & zwnj)
65 ;; T: Transparent (combining marks)
122 (0xE800 ?C) ; dummy dotted-circle
123 (0xFB50 0xFDFF ?X) ; Arabic Presentation Forms-A
124 (0xFE70 0xFEFC ?X) ; Arabic Presentation Forms-B
130 (".*X.*" (cond ("[DLRAUX]T*" < = * >) ("." =)) *)
132 ;; LAM-ALEF pattern. Move diacritcs on LAM after ALEF. This is to
133 ;; avoid loosing surrounding separators by OTF's liga or rlig
134 ;; features in the next step.
137 ("(.)(T*)(A)(T*)([DLRA].*)"
143 ("(.)(T*)(A)(T*)(.*)" ; == (D)(T*)(U.*)
156 ("(.)(T*)(.*)" ; == (D)(T*)(U.*)
166 ;; Incorrect leading diacritcs.
168 (1 (cond ((font-facility 0x25CC)
169 (cond ("." 0x25CC | = |)) *)
170 ("." 0xE800 | = |)) *)
175 ;; LAM-ALEF pattern. See the above comment.
178 ("(.)(T*)(A)(T*)([DLRA].*)"
184 ("(.)(T*)(A)(T*)(.*)" ; == (D)(T*)(U.*)
197 ("(.)(T*)(.*)" ; == (D)(T*)(U.*)
209 ;; LAM-ALEF pattern. See the above comment.
212 ("(.)(T*)(A)(T*)([DLRA].*)"
218 ("(.)(T*)(A)(T*)(.*)" ; == (D)(T*)(U.*)
231 ("(.)(T*)(.*)" ; == (D)(T*)(U.*)
236 ("(.)(T*)(.*)" ; == ([RU])(T*)(.*)
241 ;; Step 2: Remaining GSUB features (ligature, etc.).
245 otf:arab=rlig,calt,liga,dlig,cswh,mset+))
247 ;; Step 3: Simulate missing GPOS features.
252 ("C ([^ ]) " ; dummy dotted-circle
254 ("([^ ]) ([^ ]+)? ([^ ]+)? " ; LAM-ALEF ligature
255 < (1 =) (2 ("." Br.Br =) *) (3 ("." Bl.Bl =) *) >)
257 < (1 =) (2 ("." Bc.Bc =) *) >)
258 ("([^ ])([^ ]) ([^ ]+)? ([^ ]+)? " ; failed LAM-ALEF ligature
259 (1 < =) (3 ("." Br.Br =) *) > (2 < = ) (4 ("." Bl.Bl =) *) >)
264 ;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
265 ;; National Institute of Advanced Industrial Science and Technology (AIST)
266 ;; Registration Number H15PRO112
268 ;; This file is part of the m17n database; a sub-part of the m17n
271 ;; The m17n library is free software; you can redistribute it and/or
272 ;; modify it under the terms of the GNU Lesser General Public License
273 ;; as published by the Free Software Foundation; either version 2.1 of
274 ;; the License, or (at your option) any later version.
276 ;; The m17n library is distributed in the hope that it will be useful,
277 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
278 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
279 ;; Lesser General Public License for more details.
281 ;; You should have received a copy of the GNU Lesser General Public
282 ;; License along with the m17n library; if not, write to the Free
283 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
284 ;; Boston, MA 02110-1301, USA.