From: ntakahas Date: Fri, 17 Aug 2007 05:01:21 +0000 (+0000) Subject: Rewritten with new algorithm. X-Git-Tag: REL-1-5-0~74 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5f7c8b0c56ff558a79c41eed5d082572fc2791d;p=m17n%2Fm17n-db.git Rewritten with new algorithm. --- diff --git a/FLT/TAML-OTF.flt b/FLT/TAML-OTF.flt index 8e18a5f..fa3347b 100644 --- a/FLT/TAML-OTF.flt +++ b/FLT/TAML-OTF.flt @@ -23,97 +23,84 @@ ;;;
  • TAML-OTF.flt ;;; -;;; For Tamil OpenType fonts to draw Tamil. -;;; Fonts are available from . +;;; For Tamil OpenType fonts to draw the Tamil script. (font layouter taml-otf nil (font (nil nil unicode-bmp :otf=taml=akhn))) (category - ;; C: general consonant - ;; V: independent vowel + ;; C: consonant ;; H: HALANT - ;; m: MATRA (pre) - ;; u: MATRA (above) - ;; b: MATRA (below) - ;; p: MATRA (post) - ;; A: vowel modifier (above) - ;; a: vowel modifier (post) - ;; N: ZWNJ (ZERO WIDTH NON-JOINER) - ;; J: ZWJ (ZERO WIDTH JOINER) - ;; E: ELSE - ;; + ;; m: vowel sign (pre) + ;; u: vowel sign (above) + ;; b: vowel sign (below) + ;; p: vowel sign (post) + ;; X: generic + (0x0B80 0x0BFF ?X) ; generic + (0x0B95 0x0BB9 ?C) ; LETTER KA .. HA + (0x0BBE 0x0BBF ?p) ; VOWEL SIGN AA .. I + (0x0BC0 ?u) ; VOWEL SIGN II + (0x0BC1 0x0BC2 ?b) ; VOWEL SIGN U .. UU + (0x0BC6 0x0BC8 ?m) ; VOWEL SIGN E .. AI + (0x0BCD ?H) ; SIGN VIRAMA + (0x0BD7 ?p) ; AU LENGTH MARK + (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA (0x200C ?N) ; ZWNJ - (0x200D ?J) ; ZWJ - (0x0964 ?E) ; DANDA - (0x0965 ?E) ; DOUBLE DANDA - (0x0B80 0x0BFF ?E) ; ELSE - (0x0B85 0x0B94 ?V) ; LETTER AA .. LETTER AU - (0x0B95 0x0BB9 ?C) ; LETTER KA .. LETTER HA - (0x0BBE ?p) ; VOWEL SIGN AA (post) - (0x0BBF ?p) ; VOWEL SIGN I (post) - (0x0BC0 ?u) ; VOWEL SIGN II (above) - (0x0BC1 ?b) ; VOWEL SIGN U (below) - (0x0BC2 ?b) ; VOWEL SIGN UU (below) - (0x0BC6 0x0BC8 ?m) ; VOWEL SIGN E, EE, AI (pre) - (0x0BCA 0x0BCC ?t) ; VOWEL SIGN O, OO, AU (two-part) - (0x0BCD ?H) ; VIRAMA - (0x0BD7 ?p) ; AU LENGTH MARK (post) ) -;; Step 1 : Syllable identification. +;; Preprocessing. (generator (0 (cond - ;; Special ligature SRI - ((0x0BB8 0x0BCD 0x0BB0 0x0BC0) - otf:taml=akhn) - - ;; A syllable ending with a two-part vowel sign. - ("((CH)*C)(t)" - < | (1 otf:taml=akhn) (3 two-part) | >) - - ;; A syllable ending with a vowel sign. - ("((CH)*C)([mubp])" - < | (1 otf:taml=akhn) (3 =) | >) - - ;; No vowel sign. - ("(CH)*CH?" - < | otf:taml=akhn | >) - + ;; Decompose two-part vowel signs. + ((0x0BCA) + 0x0BC6 0x0BBE) + ((0x0BCB) + 0x0BC7 0x0BBE) + ((0x0BCC) + 0x0BC6 0x0BD7) ;; A variation of AU. ((0x0B92 0x0BD7) 0x0B94) - + ;; TAMu and TSCu fonts generate the SRI ligature with 'akhn'. + ;; (lohit and latha do it with 'half' + 'abvs'.) + ((0x0BB8 0x0BCD 0x0BB0 0x0BC0) + otf:taml=akhn+) ("." =)) - *) + *)) - (two-part +;; Syllable identification. +(generator + (0 (cond - ((0x0BCA) - 0x0BC6 0x0BBE) - ((0x0BCB) - 0x0BC7 0x0BBE) - ((0x0BCC) - 0x0BC6 0x0BD7)))) + ;; A syllable with vowel signs. + ("((CH)*C)(m|b|u|p|mp)" + < | (1 otf:taml=akhn,half+) (3 = *) | >) + + ;; No vowel signs. + ("((CH)*C)(H)?N?" + < | (1 otf:taml=akhn,half+) (3 =) | >) + + ("." =)) + *)) -;; Step 2 : Matra movements. +;; Move Matra before the base consonant. (generator (0 (cond - (" ([^ mubp]*)([^ mubp])(m)?([ubp])? " + (" ([^ m]*)([^ m])(m)(p)? " | (1 = *) (3 =) (2 =) (4 =) |) ("." =)) *)) -;; Step 3 : OTF substitutions and positionings. +;; Apply other OTF features. (generator (0 (cond - (" ([^ ]*) " - (1 otf:taml)) + (" ([^ ]+) " + (1 otf:taml=pres,abvs,blws,psts,haln+abvm,blwm,dist)) ("." - [ otf:taml=+ ])) + [ = ])) *)) ;; Local Variables: