X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=BEN-OTF.flt;h=20c936619f1425237d3693ba2bbe5f30574485b2;hb=4764a0459e3b472d630f251b3066dd434fea13ad;hp=7824f8c06754b88873dabddfa148ed6ebca829c0;hpb=7c7a9cad282933396a0070e5e4322063fbf58ab2;p=m17n%2Fm17n-db.git diff --git a/BEN-OTF.flt b/BEN-OTF.flt index 7824f8c..20c9366 100644 --- a/BEN-OTF.flt +++ b/BEN-OTF.flt @@ -23,7 +23,7 @@ ;;;
  • BEN-OTF.flt ;;; -;;; For Bengali OpenType fonts to draw Bengali script. Tested with +;;; For Bengali OpenType fonts to draw the Bengali script. Tested with ;;; MuktiNarrow.ttf ;;; and ;;; LikhanNormal.otf @@ -38,9 +38,7 @@ ;; m: MATRA (pre) ;; b: MATRA (below) ;; p: MATRA (post) - ;; o: MATRA (two-part O) - ;; u: MATRA (two-part AU) - ;; U: AU LENGTH MARK + ;; t: MATRA (two-part) ;; A: vowel modifier (above) ;; a: vowel modifier (post) ;; V: independent vowel @@ -74,13 +72,13 @@ (0x09DF ?C) ; LETTER YYA (0x09E0 0x09E1 ?V) ; LETTER VOCALIC RR, LL (0x09E2 0x09E3 ?b) ; VOWEL SIGN L .. LL (below) - (0x09F1 0x09F2 ?C) ; LETTER RR', RR'' (assamese) + (0x09F0 0x09F1 ?C) ; LETTER RR', RR'' (assamese) (0x09FE ?x) ; mark #1 (internal use) (0x09FF ?y) ; mark #2 (internal use) ) ;; Step 1 : Syllable identification. Recognised syllables are quoted -;; by the virtual character, which is generated by the command "|" and +;; by the pseudo character, which is generated by the command "|" and ;; has the category " " (space). (generator (0 @@ -93,28 +91,34 @@ ;; canonicalisation. ;; Case A : A syllable ending with a vowel modifier. - ("(([CRBY]n?H[NJ]?)*([CRBY]n?))([mbp]*)(t)?([Aa])" + ;;1 23 4 5 6 7 + ("(RH)?(([CRBY]n?H[NJ]?)*([CRBY]n?))([mbp]*)(t)?([Aa])" < | - (1 set-marks) - (4 = *) - (5 split) - (6 =) + (1 = =) + (2 set-marks) + (5 = *) + (6 split) + (7 =) | >) ;; Case B : A syllable ending with a two-part vowel. - ("(([CRBY]n?H[NJ]?)*([CRBY]n?))(t)" + ;;1 23 4 5 + ("(RH)?(([CRBY]n?H[NJ]?)*([CRBY]n?))(t)" < | - (1 set-marks) - (4 split) + (1 = =) + (2 set-marks) + (5 split) | >) ;; Case C : A syllable ending with other vowel. Note that a ;; two-part vowel may be expressed with two vowel marks for ;; backward compatibility. - ("(([CRBY]n?H[NJ]?)*([CRBY]n?))([mbp]+)" + ;;1 23 4 5 + ("(RH)?(([CRBY]n?H[NJ]?)*([CRBY]n?))([mbp]+)" < | - (1 set-marks) - (4 = *) + (1 = =) + (2 set-marks) + (5 = *) | >) ;; Case D : Ya-phalaa. Reorder H and Y for the next step. @@ -122,9 +126,9 @@ ;; says "it should be ;; permissible for the Ya-phalla to be consistently formed by "ZWNJ ;; + VIRAMA + YA". - ("([CBRY]N)(H)(Y)" + ("([CRBY]n?N)(H)(Y)" < | - (1 = =) + (1 = *) (3 =) (2 =) | >) @@ -132,12 +136,13 @@ ;; Case E : No explicit vowel nor modifier. If the syllable ends ;; with a consonant, analyse it for reordering in the next step. ;; Otherwise, just identify the syllable without changing anything. - ("([CRBY]n?H[NJ]?)*[CRBY]n?(HN|HJ|H)?" - (cond - (".+[^HNJ]$" - < | set-marks | >) - (".+" - < | = * | >))) + ;;1 23 4 + ("(RH)?(([CRBY]n?H[NJ]?)*[CRBY]n?)(HN|HJ|H)?" + < | + (1 = =) + (2 set-marks) + (4 = *) + | >) ;; Case F : Syllables that begin with an independent vowel. An ;; optional HYp sequence appears when this syllable represents the @@ -154,19 +159,22 @@ ;; moved. (set-marks (cond - ;; At least one C and ends with Y. - ("(([CRBY]n?H[NJ]?)*Cn?)H(([BR]H)*)Y" - (1 = *) + ;; Ending with Y. + ;;1 2 3 45 6 + ("([CRBY]n?(H[NJ]?Cn?)*)(H)(([RB]H)*)(Y)" + (1 = *) ; prebase & base 0x09FE ; mark #1 - (3 = *) ; below consonants + (4 = *) ; below consonants 0x09FF ; mark #2 - 0x09AF 0x09CD) ; YA + moved HASANT - ;; At least one C and ends with B or R. - ("(([CRBY]n?H[NJ]?)*Cn?)H(([BR]H)*[BR])" - (1 = *) + (6 =) ; YA + (3 =)) ; moved HASANT + ;; Ending with R or B. + ;;1 2 3 45 + ("([CRBY]n?(H[NJ]?Cn?)*)(H)(([RB]H)*[RB])" + (1 = *) ; prebase & base 0x09FE ; mark #1 - (3 = *) ; below consonants - 0x09CD ; moved HASANT + (4 = *) ; below consonants + (3 =) ; moved HASANT 0x09FF) ; mark #2 (".+" = * @@ -185,16 +193,23 @@ (generator (0 (cond - ;; This is the most generic pattern. It follows Case A-C and a - ;; part of Case E in Step 1. Now Mark #1 is used to indicate the - ;; critical part that requires pre-base substitution in the - ;; following steps. + ;; Special case: a single consonant and a Halant. + (" (.)xy(H[NJ]?) " + | + 0x09FE + (1 =) + (2 = *) + 0x09FE + |) - ;; 1 2 3 4 5 6 7 8 9 - (" (RH)?([^ xy]+)x([^ y]*)y(YH)?(m)?(b)?(p)?(A)?(a)? " + ;; This is the most generic pattern. It follows Cases A, B, C and + ;; E in Step 1. Now Mark #1 is used to indicate the critical part + ;; that requires pre-base substitution in the following steps. + + ;; 1 2 3 4 5 6 7 8 9 10 + (" (RH)?([^ xy]+)x([^ y]*)y(YH)?(m)?(b)?(p)?(A)?(a)?(HN|HJ|H)? " | (5 =) ; [Mpre] - 0x09FE ;; Actually, the nukt feature is not necessary for Bengali because ;; all the necessary Nukta forms are precomposed in the Unicode ;; standard. Even if a Nukta consonant is given in the form of @@ -204,8 +219,9 @@ ;; operation is also applied here, before applying the half form ;; operation because the Mukti font generates Akhand ligatures ;; directly from the "C H C" sequence, not via the half form. + 0x09FE ; begin Cpre & Cbase (2 otf:beng=nukt,akhn) ; {Cpre + H} + Cbase - 0x09FE + 0x09FE ; end Cpre & Cbase (3 otf:beng=blwf) ; {Cbelow + H} (6 =) ; [Mbelow] (1 otf:beng=rphf) ; [Reph] @@ -213,6 +229,7 @@ (4 otf:beng=pstf) ; [Cpost + H] (7 =) ; [Mpost] (9 =) ; [VMpost] + (10 = *) ; optional HASANT |) ;; Syllables that begin with an independent vowel (following up @@ -229,30 +246,18 @@ ;; Ya-phalaa (following up Step 1, Case D). Remove N and change YH ;; to the post base form. Syllables of this type do not require ;; further modification. - (" ([CBRY])N(YH) " + (" ([CBRY]n?)N(YH) " | (1 =) (2 otf:beng=pstf) |) - ;; Syllables that end with an H and an optional N or J (following - ;; up a part of Step 1, Case E). Syllables of this type also - ;; require pre-base substitution in the following steps. - (" ([^ ]+H[NJ]?) " - | - 0x09FE - ;; Only Nukt and Akhn are applied here. See the comment in the - ;; topmost sibling for explanation. - (1 otf:beng=nukt,akhn) - 0x09FE - |) - ("." =)) *)) -;; Step 3 : Now only those syllables that contain the virtual -;; character x require pre-base substition. This is the most -;; complicated part in this FLT. +;; Step 3 : Now only those syllables that contain the pseudo character +;; x require pre-base substition. This is the most complicated part +;; in this FLT. ;; If the sequence "C1 H C2" makes ligature L12, L12 replaces the ;; original sequence. @@ -275,7 +280,7 @@ ;; into the _Halant_ (not half) form of C1. However, there is no way ;; to reconvert C1half into C1halant nor to revert back to "C1 H". ;; Thus we duplicate the critical part in two different forms so that -;; we can select the appropriate one in the next step. The virtual +;; we can select the appropriate one in the next step. The pseudo ;; character x is used to indicate the boundaries. ;; ... C1 H C2 ... ==> ... x C1halant C2 x L12 x ... @@ -303,7 +308,7 @@ (0x09CD ?H) ; SIGN VIRAMA (HASANT) (0x0995 ?K) ; LETTER KA (0x09B7 ?S) ; LETTER SSA - (0x09A8 ?M) ; LETTER NA + (0x09A3 ?M) ; LETTER NNA (0x09AE ?M) ; LETTER MA (0x09FE ?x) ; mark #1 (internal use) ) @@ -365,7 +370,7 @@ (3 = *) |) - ;; KA-SSA-NA and KA-SSA-MA are the only pre-base ligatures that + ;; KA-SSA-NNA and KA-SSA-MA are the only pre-base ligatures that ;; consist of three consonants. ;; 1 23 4 5 6 7 (" ([^x ]*)x((KH)(SH)(M))(H)?x([^ ]*) " @@ -374,7 +379,7 @@ 0x09FE ; x (3 otf:beng=haln) ; KAhalant (4 otf:beng=haln) ; SSAhalant - (5 =) ; NA or MA + (5 =) ; NNA or MA 0x09FE ; x (2 otf:beng=half,haln,pres) ; ligature result 0x09FE ; x