From f88cc4d6dd9ca8cfbae25aa1d8f1912d54444aca Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 26 Feb 2010 21:40:46 +0900 Subject: [PATCH] Fix Myanmar OTF support --- lisp/ChangeLog | 11 +++++++++++ lisp/international/characters.el | 3 ++- lisp/international/fontset.el | 4 +++- lisp/language/burmese.el | 22 ++++++++++++++++++++-- src/ChangeLog | 2 ++ src/ftfont.c | 18 +++++++++--------- 6 files changed, 47 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 59bd441f0d..fd603c3856 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2010-02-26 Kenichi Handa + + * 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 * progmodes/cc-engine.el (c-clear-<-pair-props) diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 426ea0fdab..fb7c573cea 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -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) diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 4a2173fb27..767cff850f 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -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 diff --git a/lisp/language/burmese.el b/lisp/language/burmese.el index a89ffe28f2..554cd7a482 100644 --- a/lisp/language/burmese.el +++ b/lisp/language/burmese.el @@ -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 diff --git a/src/ChangeLog b/src/ChangeLog index 36e056b786..f60b400b93 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2010-02-26 Kenichi Handa + * 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 diff --git a/src/ftfont.c b/src/ftfont.c index 492d03bb8b..f4fe5b8e5c 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -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; -- 2.20.1