Fix Myanmar OTF support
authorKenichi Handa <handa@m17n.org>
Fri, 26 Feb 2010 12:40:46 +0000 (21:40 +0900)
committerKenichi Handa <handa@m17n.org>
Fri, 26 Feb 2010 12:40:46 +0000 (21:40 +0900)
lisp/ChangeLog
lisp/international/characters.el
lisp/international/fontset.el
lisp/language/burmese.el
src/ChangeLog
src/ftfont.c

index 59bd441..fd603c3 100644 (file)
@@ -1,3 +1,14 @@
+2010-02-26  Kenichi Handa  <handa@m17n.org>
+
+       * language/burmese.el: Fix entries in composition-function-table.
+       (myanmar-composable-pattern): New variable.
+
+       * international/fontset.el (setup-default-fontset): Add an entry
+       for myanmar.
+
+       * international/characters.el (script-list): Add Myanmar
+       Extended-A.
+
 2010-02-25  Alan Mackenzie  <acm@muc.de>
 
        * progmodes/cc-engine.el (c-clear-<-pair-props)
index 426ea0f..fb7c573 100644 (file)
@@ -1124,7 +1124,7 @@ Setup char-width-table appropriate for non-CJK language environment."
         (#x0E00 #x0E5F thai)
         (#x0E80 #x0EDF lao)
         (#x0F00 #x0FFF tibetan)
-        (#x1000 #x105F myanmar)
+        (#x1000 #x109F myanmar)
         (#x10A0 #x10FF georgian)
         (#x1100 #x11FF hangul)
         (#x1200 #x139F ethiopic)
@@ -1151,6 +1151,7 @@ Setup char-width-table appropriate for non-CJK language environment."
         (#x3400 #x9FAF han)
         (#xA000 #xA4CF yi)
         (#xAA00 #xAA5F cham)
+        (#xAA60 #xAA7B myanmar)
         (#xAA80 #xAADF tai-viet)
         (#xAC00 #xD7AF hangul)
         (#xF900 #xFAFF han)
index 4a2173f..767cff8 100644 (file)
      (sinhala ,(font-spec :registry "iso10646-1" :otf '(sinh nil (akhn))))
      (malayalam ,(font-spec :registry "iso10646-1" :otf '(mlym nil (akhn))))
 
+     (myanmar ,(font-spec :registry "iso10646-1" :otf '(mymr))
+             ,(font-spec :registry "iso10646-1" :script 'myanmar))
+
      (lao ,(font-spec :registry "iso10646-1" :otf '(lao\  nil nil (mark)))
          ,(font-spec :registry "iso10646-1" :script 'lao)
          (nil . "MuleLao-1"))
                    armenian
                    syriac
                    thaana
-                   myanmar
                    georgian
                    cherokee
                    canadian-aboriginal
index a89ffe2..554cd7a 100644 (file)
             (sample-text . "Burmese (မ္ရန္‌မာ) မင္‍ဂလာပာ")
             (documentation . t)))
 
-(set-char-table-range composition-function-table '(#x1000 . #x107F)
-                     '(["[\x1000-\x107F\x200C\x200D]+" 0 font-shape-gstring]))
+(defvar myanmar-composable-pattern
+  (let ((table
+        '(("K" . "[\u1004\u105A]\u103A\u1039") ; KINZI sequence
+          ("C" . "[\u1000-\u102A\u103F\u1041-\u1049\u104E\u105A-\u105D\u1061\u1065-\u1066\u106E\u1071\u1075\u1081\u108E\uAA60-\uAA6F\uAA71-\uAA76]") ; consonant and vowel letter
+          ("V" . "\u1039")                                        ; VIRAMA
+          ("A" . "\u103A")                                        ; ASAT
+          ("S" . "[\u1000-\u1019\u101C\u101E\u1020\u1021\u105A]") ; subscript
+          ("M" . "[\u103B-\u103E\105E-\1060]") ; medial
+          ("v" . "[\u102B-\u103A\u103C-\u103E\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A\u109C\uAA70]"))) ; vowel sign, etc.
+       (regexp "\\(K\\)?C\\(VS\\)?\\(VS\\)?A?M*v*"))
+    (let ((case-fold-search nil))
+      (dolist (elt table)
+       (setq regexp (replace-regexp-in-string (car elt) (cdr elt)
+                                              regexp t t))))
+    regexp))
+
+(let ((elt (list (vector myanmar-composable-pattern 0 'font-shape-gstring)
+                (vector "." 0 'font-shape-gstring))))
+  (set-char-table-range composition-function-table '(#x1000 . #x107F) elt)
+  (set-char-table-range composition-function-table '(#xAA60 . #xAA7B) elt))
 
 ;; arch-tag: 8ba5f4cd-ef89-4008-b784-397edd0cb32e
index 36e056b..f60b400 100644 (file)
@@ -1,5 +1,7 @@
 2010-02-26  Kenichi Handa  <handa@m17n.org>
 
+       * ftfont.c (ftfont_get_open_type_spec): Fix parsing of otf_spec.
+
        * xdisp.c (reseat_to_string): Fix previous change.
 
 2010-02-26  David Reitter  <david.reitter@gmail.com>
index 492d03b..f4fe5b8 100644 (file)
@@ -663,19 +663,19 @@ ftfont_get_open_type_spec (Lisp_Object otf_spec)
   else
     spec->script_tag = 0x44464C54;     /* "DFLT" */
   otf_spec = XCDR (otf_spec);
-  val = XCAR (otf_spec);
-  if (! NILP (val))
-    OTF_SYM_TAG (val, spec->langsys_tag);
-  else
-    spec->langsys_tag = 0;
+  spec->langsys_tag = 0;
+  if (! NILP (otf_spec))
+    {
+      val = XCAR (otf_spec);
+      if (! NILP (val))
+       OTF_SYM_TAG (val, spec->langsys_tag);
+      otf_spec = XCDR (otf_spec);
+    }
   spec->nfeatures[0] = spec->nfeatures[1] = 0;
-  for (i = 0; i < 2; i++)
+  for (i = 0; i < 2 && ! NILP (otf_spec); i++, otf_spec = XCDR (otf_spec))
     {
       Lisp_Object len;
 
-      otf_spec = XCDR (otf_spec);
-      if (NILP (otf_spec))
-       break;
       val = XCAR (otf_spec);
       if (NILP (val))
        continue;