From 524ff54f71db8c9c9ce04804a05bd62051afb357 Mon Sep 17 00:00:00 2001 From: ntakahas Date: Thu, 21 Jun 2007 12:54:17 +0000 Subject: [PATCH] Put pre-base vowel modifier properly when the font lacks consonant conjunction. --- FLT/DEVA-OTF.flt | 111 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 43 deletions(-) diff --git a/FLT/DEVA-OTF.flt b/FLT/DEVA-OTF.flt index a4d71ad..37da5b7 100644 --- a/FLT/DEVA-OTF.flt +++ b/FLT/DEVA-OTF.flt @@ -45,31 +45,33 @@ ;; N: ZWNJ ;; J: ZWJ ;; X: generic - (#x0900 #x097F ?X) ; generic - (#x0901 ?A) ; SIGN CANDRABINDU - (#x0902 ?A) ; SIGN ANUSVARA - (#x0903 ?a) ; SIGN VISARGA - (#x0904 #x0914 ?V) ; LETTER SHORT A .. AU - (#x0915 #x0939 ?C) ; LETTER KA .. HA - (#x0930 ?R) ; LETTER RA - (#x093C ?n) ; SIGN NUKTA - (#x093E ?p) ; VOWEL SIGN AA - (#x093F ?m) ; VOWEL SIGN I - (#x0940 ?p) ; VOWEL SIGN II - (#x0941 #x0944 ?b) ; VOWEL SIGN UU .. VOCALIC RR - (#x0945 #x0948 ?u) ; VOWEL SIGN CANDRA E .. AI - (#x0949 #x094C ?p) ; VOWEL SIGN CANDRA O .. AU - (#x094D ?H) ; SIGN VIRAMA - (#x0951 ?S) ; STRESS SIGN UDATTA - (#x0952 ?s) ; STRESS SIGN ANUDATTA - (#x0953 #x0954 ?S) ; GRAVE ACCENT .. ACUTE ACCENT - (#x0958 #x095F ?C) ; LETTER QA .. YYA - (#x0960 #x0961 ?V) ; LETTER VOCALIC RR .. VOCALIC LL - (#x0962 #x0963 ?b) ; VOWEL SIGN VOCALIC L .. VOCALIC LL - (#x097B #x097C ?C) ; LETTER GGA .. JJA - (#x097E #x097F ?C) ; LETTER DDDA .. BBA - (#x200C ?N) ; ZWNJ - (#x200D ?J) ; ZWJ + ;; Z: internal use + (0x0900 ?Z) ; internal use + (0x0901 0x097F ?X) ; generic + (0x0901 ?A) ; SIGN CANDRABINDU + (0x0902 ?A) ; SIGN ANUSVARA + (0x0903 ?a) ; SIGN VISARGA + (0x0904 0x0914 ?V) ; LETTER SHORT A .. AU + (0x0915 0x0939 ?C) ; LETTER KA .. HA + (0x0930 ?R) ; LETTER RA + (0x093C ?n) ; SIGN NUKTA + (0x093E ?p) ; VOWEL SIGN AA + (0x093F ?m) ; VOWEL SIGN I + (0x0940 ?p) ; VOWEL SIGN II + (0x0941 0x0944 ?b) ; VOWEL SIGN UU .. VOCALIC RR + (0x0945 0x0948 ?u) ; VOWEL SIGN CANDRA E .. AI + (0x0949 0x094C ?p) ; VOWEL SIGN CANDRA O .. AU + (0x094D ?H) ; SIGN VIRAMA + (0x0951 ?S) ; STRESS SIGN UDATTA + (0x0952 ?s) ; STRESS SIGN ANUDATTA + (0x0953 0x0954 ?S) ; GRAVE ACCENT .. ACUTE ACCENT + (0x0958 0x095F ?C) ; LETTER QA .. YYA + (0x0960 0x0961 ?V) ; LETTER VOCALIC RR .. VOCALIC LL + (0x0962 0x0963 ?b) ; VOWEL SIGN VOCALIC L .. VOCALIC LL + (0x097B 0x097C ?C) ; LETTER GGA .. JJA + (0x097E 0x097F ?C) ; LETTER DDDA .. BBA + (0x200C ?N) ; ZWNJ + (0x200D ?J) ; ZWJ ) ;; Reordering @@ -93,20 +95,19 @@ ("(RH)?(([CR]n?H)*[CR]n?)((S)|(s))" < | (2 move-h) (6 =)(1 otf:deva=rphf+) (5 =) | >) - ;; A special case. + ;; A special case: eyelash RA ("(RH)J" - < | (1 otf:deva=half+) | >) + < (1 otf:deva=half+) >) ;; Forced half form. Do not move halant. ;;1 23 ("(RH)?(([CR]n?H)+)J" < | (2 = *) (1 otf:deva=rphf+) | >) - ;; If a syllable ends with a halant, or a halant and a ZWNJ, mark - ;; this syllable for the special handling in the later stages. + ;; When a syllable ends with a halant, add a ZWNJ explicitly. ;;1 23 4 5 ("(RH)?(([CR]n?H)*[CR]n?)(H)?(N)?" - < | (4 0x200C) (2 move-h) (1 otf:deva=rphf+) (4 =) | >) + < | (2 move-h) (1 otf:deva=rphf+) (4 = 0x200C) | >) ;; A syllable starting with an independent vowel. ;;1 23 4 56 7 @@ -117,27 +118,28 @@ *) ;; Move the halant that follows the base consonant to the end. + ;; Put a mark after the base consonant. (move-h (cond ;;12 3 4 56 ("(([CR]n?H)*(Cn?))(H)((RH)*R)$" - (1 = *) (5 = *) (4 =)) + (1 = *) 0x0900 (5 = *) (4 =)) ;;1 2 34 ("(R)(H)((RH)*R)$" - (1 =) (3 = *) (2 =)) - (".+" = *)))) + (1 =) 0x0900 (3 = *) (2 =)) + (".+" = * 0x0900)))) -;; Language forms -;; If a syllable is marked, render the final halant explicitly. -;; Do not apply blwf nor half to the initial RA. +;; Language forms If a syllable ends with a halant and a ZWNJ, render +;; the final halant explicitly. Do not apply 'blwf' nor 'half' to the +;; initial RA. (generator (0 (cond - (" N(R)([^ ]*)(H) " + (" (R)([^ ]*)(H)N " | (1 =) (2 gsub1) (3 =) |) - (" (R)([^ ]*) " - | (1 =) (2 gsub1) |) - (" N([^ ]+)(H) " + (" (m?R)([^ ]*) " + | (1 = *) (2 gsub1) |) + (" ([^ ]+)(H)N " | (1 gsub1) (2 =) |) (" ([^ ]+) " | (1 gsub1) |) @@ -147,14 +149,37 @@ (gsub1 otf:deva=nukt,akhn,blwf,half,vatu+)) -;; Other OTF features +;; Apply 'pres' to get pre-base conjuncts. +(generator + (0 + (cond + (" (m)?([^ ]+) " + | (1 =) (2 otf:deva=pres+) |) + ("." =)) + *)) + +;; When the number of glyphs between a pre-base vowel modifier and the +;; post-base mark is more than one, move the pre-base vowel before the +;; final glyph. +(generator + (0 + (cond + (" (m)([^Z ]+)([^Z ])Z([^ ]*) " + | (2 = *) (1 =) (3 =) (4 = *) |) + (" ([^Z ]+)Z([^ ]*) " + | (1 = *) (2 = *) |) + ("." =)) + *)) + +;; Apply other features. The 'vatu' feature is applied again to get +;; the conjunct of base and post-base. (generator (0 (cond (" ([^ ]+) " - (1 otf:deva=pres,abvs,blws,psts,haln)) + (1 otf:deva=vatu,abvs,blws,psts,haln)) ("." - \[ otf:deva=+ \] )) + [ otf:deva=+ ])) *)) ;; Local Variables: -- 1.7.10.4