From 79dd1915957792ed6600425b81718fba76e6b2ac Mon Sep 17 00:00:00 2001 From: handa Date: Wed, 15 Sep 2010 08:11:11 +0000 Subject: [PATCH] Mostly re-write for LAM-AREF ligature. --- FLT/ARAB-OTF-NO-GPOS.flt | 185 +++++++++++++++++++++++++--------------------- 1 file changed, 102 insertions(+), 83 deletions(-) diff --git a/FLT/ARAB-OTF-NO-GPOS.flt b/FLT/ARAB-OTF-NO-GPOS.flt index c378138..5922051 100644 --- a/FLT/ARAB-OTF-NO-GPOS.flt +++ b/FLT/ARAB-OTF-NO-GPOS.flt @@ -1,5 +1,5 @@ ;; ARAB-OTF-NO-GPOS.flt -- Font Layout Table for Arabic OpenType font sans GPOS -;; Copyright (C) 2005, 2006, 2007, 2008 AIST (H15PRO112) +;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 AIST (H15PRO112) ;; See the end for copying conditions. (font layouter arab-otf-no-gpos nil @@ -53,11 +53,14 @@ ((0x0678) 0x0649) ("." =)))) -;; Step 1: ccmp +;; Step 1: Initial, medial, or final. Surround diacritics by +;; separators (|). (category - ;; D: Dual-joining (beh, teh, etc. & zwj) - ;; R: Right-joining (alef, dal, thal, reh, zain) + ;; D: Dual-joining (beh, teh, etc. & zwj) except for LAMs + ;; L: LAMs + ;; R: Right-joining (alef, dal, thal, reh, zain) except for AREFs + ;; A: AREFs ;; U: Non-joining (Hamza, etc. & zwnj) ;; T: Transparent (combining marks) (0x060B 0x060F ?U) @@ -65,27 +68,27 @@ (0x061B ?U) (0x061E 0x061F ?U) (0x0621 ?U) - (0x0622 0x0623 ?R) + (0x0622 0x0627 ?A) (0x0624 ?R) - (0x0625 ?R) (0x0626 ?D) - (0x0627 ?R) (0x0628 ?D) (0x0629 ?R) (0x062A 0x062E ?D) (0x062F 0x0632 ?R) (0x0633 0x0647 ?D) + (0x0644 ?L) (0x0648 ?R) (0x0649 0x064A ?D) (0x064B 0x065E ?T) (0x0660 0x066D ?U) (0x066E 0x066F ?D) (0x0670 ?T) - (0x0671 0x0673 ?R) + (0x0671 0x0673 ?A) (0x0674 0x0678 ?U) (0x0679 0x0687 ?D) (0x0688 0x0699 ?R) (0x069A 0x06C3 ?D) + (0x06B5 0x06B8 ?L) (0x06C4 0x06CB ?R) (0x06CC 0x06CE ?D) (0x06CF ?R) @@ -116,133 +119,149 @@ (0x200C ?U) (0x200D ?D) (0x25CC ?U) + (0xE800 ?C) ; dummy dotted-circle (0xFB50 0xFDFF ?X) ; Arabic Presentation Forms-A (0xFE70 0xFEFC ?X) ; Arabic Presentation Forms-B ) -;; (generator -;; (0 -;; otf:arab=ccmp)) - -;; Step 2: Initial, medial, or final. - (generator (0 (cond - (".*X.*" (cond ("[DRUX]T*" < = * >) ("." =)) *) + (".*X.*" (cond ("[DLRAUX]T*" < = * >) ("." =)) *) - ("D.*" + ;; LAM-AREF pattern. Move diacritcs on LAM after AREF. This is to + ;; avoid loosing surrounding separators by OTF's liga or rlig + ;; features in the next step. + ("L(T*)A.*" (cond - ("(.)(T*)([DR].*)" - < + ("(.)(T*)(A)(T*)([DLRA].*)" + (1 otf:arab=init) + (3 otf:arab=fina) + (2 | = * |) + (4 | = * |) + (5 join)) + ("(.)(T*)(A)(T*)(.*)" ; == (D)(T*)(U.*) (1 otf:arab=init) - (2 = *) - > + (3 otf:arab=fina) + (2 | = * |) + (4 | = * |) + (5 disjoin)))) + + ("[DL].*" + (cond + ("(.)(T*)([DLRA].*)" + (1 otf:arab=init) + (2 | = * |) (3 join)) ("(.)(T*)(.*)" ; == (D)(T*)(U.*) - < (1 otf:arab=isol) - (2 = *) - > + (2 | = * |) (3 disjoin)))) - ("([RU])(T*)(.*)" - < + ("([RAU])(T*)(.*)" (1 otf:arab=isol) - (2 = *) - > + (2 | = * | ) (3 disjoin)) + ;; Incorrect leading diacritcs. ("(T+)(.*)" - (1 = *) + (1 (cond ((font-facilty 0x25CC) + (cond ("." 0x25CC | = |)) *) + ("." 0xE800 | = |)) *) (2 disjoin)))) (join (cond - ("D.*" + ;; LAM-AREF pattern. See the above comment. + ("L(T*)A.*" + (cond + ("(.)(T*)(A)(T*)([DLRA].*)" + (1 otf:arab=medi) + (3 otf:arab=fina) + (2 | = * |) + (4 | = * |) + (5 join)) + ("(.)(T*)(A)(T*)(.*)" ; == (D)(T*)(U.*) + (1 otf:arab=medi) + (3 otf:arab=fina) + (2 | = * |) + (4 | = * |) + (5 disjoin)))) + + ("[DL].*" (cond - ("(.)(T*)([DR].*)" - < + ("(.)(T*)([DLRA].*)" (1 otf:arab=medi) - (2 = *) - > + (2 | = * |) (3 join)) ("(.)(T*)(.*)" ; == (D)(T*)(U.*) - < (1 otf:arab=fina) - (2 = *) - > + (2 | = * |) (3 disjoin)))) ("(.)(T*)(.*)" - < (1 otf:arab=fina) - (2 = *) - > + (2 | = * |) (3 disjoin)))) (disjoin (cond - ("D.*" + ;; LAM-AREF pattern. See the above comment. + ("L(T*)A.*" + (cond + ("(.)(T*)(A)(T*)([DLRA].*)" + (1 otf:arab=init) + (3 otf:arab=fina) + (2 | = * |) + (4 | = * |) + (5 join)) + ("(.)(T*)(A)(T*)(.*)" ; == (D)(T*)(U.*) + (1 otf:arab=init) + (3 otf:arab=fina) + (2 | = * |) + (4 | = * |) + (5 disjoin)))) + + ("[DL].*" (cond - ("(.)(T*)([DR].*)" - < + ("(.)(T*)([DLRA].*)" (1 otf:arab=init) - (2 = *) - > + (2 | = * |) (3 join)) ("(.)(T*)(.*)" ; == (D)(T*)(U.*) - < (1 otf:arab=isol) - (2 = *) - > + (2 | = * |) (3 disjoin)))) ("(.)(T*)(.*)" ; == ([RU])(T*)(.*) - < (1 otf:arab=isol) - (2 = *) - > + (2 | = * |) (3 disjoin))))) -;; Step 3: GPOS features. +;; Step 2: Remaining GSUB features (ligature, etc.). + +(generator + (0 + otf:arab=rlig,calt,liga,dlig,cswh,mset+)) + +;; Step 3: Simulate missing GPOS features. (generator (0 (cond - ((0x0651 0x0650) tc+bc 0x064E tc+bc 0x0651) ; shadda + kasra - ((0x0651 0x064D) tc+bc 0x064B tc+bc 0x0651) ; shadda + kasratan - ((range 0x0610 0x0615) tc+bc =) - ((0x064B) tc+bc =) - ((0x064C) tc+bc =) - ((0x064D) bc-tc =) - ((0x064E) tc+bc =) - ((0x064F) tc+bc =) - ((0x0650) bc-tc =) - ((range 0x0651 0x0654) tc+bc =) - ((0x0655) bc-tc =) - ((0x0656) bc-tc =) - ((range 0x0657 0x065B) tc+bc =) - ((0x065C) bc-tc =) - ((0x065D) tc+bc =) - ((0x065E) tc+bc =) - ((0x0670) tc+bc =) - ((range 0x06D6 0x06DC) tc+bc =) - ((range 0x06DF 0x06E2) tc+bc =) - ((0x06E3) bc-tc =) - ((0x06E4) tc+bc =) - ((0x06E7) tc+bc =) - ((0x06E8) tc+bc =) - ((0x06EA) bc-tc =) - ((0x06EB) tc+bc =) - ((0x06EC) tc+bc =) - ((0x06ED) bc-tc =) - ((0x200C) =) - ((0x200D) =) - ("." =)) + ("C ([^ ]) " ; dummy dotted-circle + [ (1 =) ]) + ("([^ ]) ([^ ]+)? ([^ ]+)? " ; LAM-AREF ligature + < (1 =) (2 Br.Br = *) (3 Bl.Bl = *) >) + ("([^ ]) ([^ ]+)? " + < (1 =) (2 Bc.Bc = *) >) + ("([^ ])([^ ]) ([^ ]+)? ([^ ]+)? " ; failed LAM-AREF ligature + < (1 =) (3 Br.Br = *) (2 = ) (4 Bl.Bl = *) >) + ("[^ ]" =) + (" ")) *)) -;; Copyright (C) 2005, 2006, 2007, 2008 +;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H15PRO112 @@ -265,5 +284,5 @@ ;; Boston, MA 02110-1301, USA. ;; Local Variables: -;; mode: lisp +;; mode: emacs-lisp ;; End: -- 1.7.10.4