changeset 107239:149e318a8b2d

Fix Myanmar OTF support
author Kenichi Handa <handa@m17n.org>
date Fri, 26 Feb 2010 21:45:47 +0900
parents ca680936225c (current diff) bf1a617b8f8a (diff)
children 8953c1cd8568 1ee7f5caa71f
files
diffstat 6 files changed, 47 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Feb 25 20:59:04 2010 -0800
+++ b/lisp/ChangeLog	Fri Feb 26 21:45:47 2010 +0900
@@ -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-26  Glenn Morris  <rgm@gnu.org>
 
 	* custom.el (custom-initialize-delay): Doc fix.
--- a/lisp/international/characters.el	Thu Feb 25 20:59:04 2010 -0800
+++ b/lisp/international/characters.el	Fri Feb 26 21:45:47 2010 +0900
@@ -1124,7 +1124,7 @@
 	 (#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 @@
 	 (#x3400 #x9FAF han)
 	 (#xA000 #xA4CF yi)
 	 (#xAA00 #xAA5F cham)
+	 (#xAA60 #xAA7B myanmar)
 	 (#xAA80 #xAADF tai-viet)
 	 (#xAC00 #xD7AF hangul)
 	 (#xF900 #xFAFF han)
--- a/lisp/international/fontset.el	Thu Feb 25 20:59:04 2010 -0800
+++ b/lisp/international/fontset.el	Fri Feb 26 21:45:47 2010 +0900
@@ -415,6 +415,9 @@
      (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"))
@@ -548,7 +551,6 @@
 		    armenian
 		    syriac
 		    thaana
-		    myanmar
 		    georgian
 		    cherokee
 		    canadian-aboriginal
--- a/lisp/language/burmese.el	Thu Feb 25 20:59:04 2010 -0800
+++ b/lisp/language/burmese.el	Fri Feb 26 21:45:47 2010 +0900
@@ -36,7 +36,25 @@
 	     (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
--- a/src/ChangeLog	Thu Feb 25 20:59:04 2010 -0800
+++ b/src/ChangeLog	Fri Feb 26 21:45:47 2010 +0900
@@ -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>
--- a/src/ftfont.c	Thu Feb 25 20:59:04 2010 -0800
+++ b/src/ftfont.c	Fri Feb 26 21:45:47 2010 +0900
@@ -663,19 +663,19 @@
   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;