Big change for supporting backspace well.
[m17n/m17n-db.git] / MYMR-MYAZEDI.flt
index 9526120..675bce1 100644 (file)
@@ -1,5 +1,5 @@
-;; MYANMAR-ZEDI.flt -- Font Layout Table for Myanmar (Zedi font)
-;; Copyright (C) 2004
+;; MYMR-MYAZEDI.flt -- Font Layout Table for Myanmar (Zedi font)
+;; Copyright (C) 2004, 2005, 2006
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H15PRO112
 
 ;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 ;; 02111-1307, USA.
 
-;;; <li> MYANMAR-ZEDI.flt
+;;; <li> MYMR-MYAZEDI.flt
 ;;;
 ;;; For the Myanmar Zedi family fonts to draw Myanmar script.
 ;;; <ul>
-;;; <li> infopage: http://www.myazedi.com/downloads/MyaZedi_M17N.ttf
+;;; <li> download: http://www.myazedi.com/downloads/MyaZedi_M17N.ttf
 ;;; </ul>
 
 ;; 1st stage
 
 (category
  (0x1000 0x107F ?O)                    ; other
- (0x1000 0x1021 ?C)                    ; consonant except for c and K
+ (0x1000 0x1021 ?C)                    ; consonant except for c, K, n, M
  (0x1000 0x1003 ?c)                    ; consonant that has subscript form
  (0x1004       ?K)                     ; consonant NGA
  (0x1005 0x1008 ?c)
  (0x100B 0x100C ?c)
  (0x100F 0x1019 ?c)
+ (0xE014       ?c)
+ (0xE01B       ?c)
  (0x1014       ?n)                     ; consonant NA
  (0x101C       ?c)
- (0x101A       ?M)                     ; cosonant that may be used as Medial
- (0x101B       ?r)                     ; Medial Ra
- (0x101D       ?M)
- (0x101F       ?M)
+ ;; cosonants that can be a Medial
+ (0x101A       ?M)                     ; medial Ya
+ (0x101B       ?M)                     ; medial Ra 
+ (0x101D       ?M)                     ; medial Wa
+ (0x101F       ?M)                     ; medial Ha
  (0x1021 0x102A ?I)                    ; independent vowel
  (0x102C 0x1032        ?V)                     ; dependent Vowel
  (0x1036       ?A)                     ; sign ANUSVARA
  (0x1037 0x1038        ?S)                     ; other sign
  (0x1039       ?H)                     ; HALANT (VIRAMA)
  (0x200C       ?N)                     ; ZWNJ (Zero Width Non Joiner)
+ (0x200D       ?J)                     ; ZWJ (Zero Width Joiner)
  )
 
 (generator
  (0
   (cond
-   ;; Special case for Medial Ra: don't use Kinzi for this pattern.
-   ("(K)(Hr(HM)*)(V*A?H?)N?(S*)"
-    | < (1 =) (2 remove-halant *) (4 = *) (5 = *) > |)
-
-   ;; The following regular expression matches a syllable pattern
-   ;; described in Table 10-3 of the Unicode Standard 4.0 .
-   ;;<1-> <--------2--------><--4--><--6--->  <7->
-   ;;             <---3--->   <5->
-   ("(KH)?([CcnKMr](H[CcnK])?)((H[Mr])*)(V*A?H?)N?(S*)"
+   ;; The following regular expression matches a graphme cluster pattern
+   ;; described in Table 10-3 of the Unicode Standard 4.0 except for
+   ;; Kinzi which is encoded by the sequence "U+1004 U+1039 U+200D".
+   ;; 
+   ;;<-1-><---------2--------><--4--><--6--->  <7->
+   ;;              <---3--->   <5->
+   ("(KHJ)([CcnKMr](H[CcnK])?)((HM)*)(V*A?H?)N?(S*)"
     | < (1 0xE390) (2 consonant) (4 remove-halant *) (6 = *) (7 = *) > |)
 
+   ;; Irregular independent Kinzi
+   ("KHJ"
+    [ 0xE390 ])
+
+   ;; Cluster without Kinzi
+   ("([CcnKMr](H[CcnK])?)((HM)*)(V*A?H?)N?(S*)"
+    | < (1 consonant) (3 remove-halant *) (5 = *) (6 = *) > |)
+
    ;; Fixme: I'm not sure about the syllable pattern for an
    ;; independent vowel.
    ("IV*[AS]*"
    ("." =)))
 
  (subscript
-  (cond ((range 0x1000 0x101c) 0xE000)))
+  (cond ((range 0x1000 0x101C) 0xE000)))
 
  (remove-halant
   (cond
 
    ;; Medial Ha (U+101F)
    ((0x100A 0x101F)    0x100A 0xE1F3)
-   ("(..?)f"           (1 = =) 0xE1F1))))
+   ("(..?)f"           (1 = *) 0xE1F1))))
 
 ;; 3rd stage
 ;; Reorder Kinzi and Vowel E.  Handle Kinzi-vowel combination.
  (0x1036 0x1038        ?D)
  (0x1039       ?H)
  (0x200C       ?N)
+ (0x200D       ?J)
  (0xE000 0xE3FF ?O)
  (0xE000 0xE01D ?b)
+ (0xE140       ?B)
  (0xE1A1 0xE1B0 ?b)
  (0xE1B1 0xE1BA ?B)
- (0xE140       ?C)
+ (0xE1D1 0xE1F1 ?B)
+ (0xE20D       ?b)
  (0xE390       ?K)                     ; Kinzi
-)
+ )
 
 (generator
  (0
  (0
   (cond
    (" ([^ ]*) "
+    |
     (1
      (cond
       ;; Consonant substituion.
-      ((0x1009 0x1039) 0xE009 0x1039)
-      ((0x1009 0xE005) 0xE109 0xE005)
-      ((0x101B 0x102F) 0xE01B 0x102F)
+      ((0x1009 0x1039) 0x1025 0x1039)
+      ((0x1009 0xE005) 0xE109 Br>5Bl 0xE005)
+;;       ((0x101B 0x102F) 0xE01B 0x102F)
+;;       ((0x101B 0x1030) 0xE01B 0x1030)
+;;       ((0x1014 0x102F) 0xE140 0x102F)
+;;       ((0x1014 0x1030) 0xE140 0x1030)
 
-      ;; Sign substituion.
-      ((0x1014 0x1037) 0x1014 0xE037)
-      ((0x101B 0x1037) 0x101B 0xE137)
+;;       ;; Sign substituion.
+;;       ((0x102F 0x1037) 0x102F 0xE137)
+;;       ((0x1030 0x1037) 0x1030 0xE137)
+;;       ((0xE01D 0x1037) 0xE01D 0xE137)
+;;       ((0xE1A1 0x1036 0x1037) 0xE1A1 0x1036 0xE137)
+;;       ((0xE1A1 0x1032 0x1037) 0xE1A1 0x1032 0xE137)
+;;       ((0xE01D 0x1032 0x1037) 0xE01D 0x1032 0xE137)
+;;       ((0xE01D 0x1036 0x1037) 0xE01D 0x1036 0xE137)
 
       ;; Vowel substituion.
       ((0xE1F1 0x102F) 0xE1F2)
+      ((0xE1F1 0x102D 0x102F)  0xE1F2 0x102D)
+      ((0xE1F1 0x102E 0x102F)  0xE1F2 0x102E)
+      ((0xE1F1 0x1032 0x102F)  0xE1F2 0x1032)
       ("BcK?A"         = = = =)
       ("cAH"           = 0xE02D)
       ("cA"            = 0xE02C)
       ("([bB][^u]*)u"  (1 = *) 0xE2F1)
       ("([bB][^u]*)U"  (1 = *) 0xE2F2)
       ("." =))
-     *))
-   ((0x200C)   0x4E tc.cc 0x48)
+     *)
+    |)
+   ("."
+    =))
+  *))
+
+;; 5th stage
+;; Adjust below characters (U+102F, U+1037, etc)
+
+(category
+ (0x1000 0x107F ?O)
+ (0x200C 0x200D        ?O)
+ (0xE000 0xE3FF ?O)
+ (0x1014       ?T)                     ; tall consonant (substituted)
+ (0x101B       ?T)
+ (0x102F 0x1030        ?B)                     ; below position (substitute tall one)
+ (0x1037       ?b)                     ; shift to right
+ (0xE01D       ?B)
+ (0xE1A1       ?B)
+ (0xE1D1       ?B)
+ (0xE1B1 0xE1BA ?L)
+ (0xE1F1 0xE1F2        ?B)
+ (0xE2F1 0xE2F2 ?L)                    ; has lower part
+ )
+
+(generator
+ (0
+  (cond
+   (" ([^ ]*) "
+    |
+    (1
+     (cond
+      ("(T)(B)([OL])?(b)?"
+       (1 (cond ((0x1014) 0xE140) ((0x101B) 0xE01B)))
+       (2 =)
+       (3 = *)
+       (4 0xE137))
+      ("([TBL])(O*)?(b)"
+       (1 =) (2 = *) (3 0xE137))
+      ("." =))
+     *)
+    |)
+   ("OO*" = *)
+   ("." =))
+  *))
+
+;; 6th stage
+;; Adjust conbination of normal consonant and wide subconsonant.
+
+(category
+ (0x1000 0x107F ?O)
+ (0x200C 0x200D        ?O)
+ (0xE000 0xE3FF ?O)
+ (0x1001 0x1002 ?n)
+ (0x1004 0x1005 ?n)
+ (0x1007       ?n)
+ (0x100E       ?n)
+ (0x1012 0x1013 ?n)
+ (0x1015 0x1017 ?n)
+ (0x1019       ?n)
+ (0x101D       ?n)
+ (0xE000       ?w)
+ (0xE003       ?w)
+ (0xE006       ?w)
+ (0xE00C       ?w)
+ (0xE00F       ?w)
+ (0xE010 0xE011 ?w)
+ (0xE018       ?w))
+
+(generator
+ (0
+  (cond
+   (" (n)(w)([^ ]*) "
+    \[ (1 =) (2 Br>17Bl =) (3 = *))
+   (" ([^ ]*) "
+    (1 = *))
    ("."
     =))
   *))
 
 ;; Local Variables:
-;; mode: lisp
+;; mode: emacs-lisp
 ;; coding: utf-8
 ;; End: