From: Kenichi Handa Date: Tue, 30 Dec 2008 23:34:54 +0000 (+0000) Subject: (compose-gstring-for-variation-glyph): New X-Git-Tag: emacs-pretest-23.0.90~790 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ee946858594753b55dab38e303cc650a56bb063d;p=emacs.git (compose-gstring-for-variation-glyph): New function. Register it in composition-function-table. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a172cd5d531..c06dff83cab 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2008-12-30 Kenichi Handa + + * language/japanese.el (compose-gstring-for-variation-glyph): New + function. Register it in composition-function-table. + + * composite.el (lglyph-set-code): New function. + 2008-12-30 Stefan Monnier * tar-mode.el (tar-data-swapped): New var. diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el index 73c3508a9d1..6789e7cdb60 100644 --- a/lisp/language/japanese.el +++ b/lisp/language/japanese.el @@ -250,6 +250,29 @@ eucJP-ms is defined in ." (define-translation-table 'unicode-to-jisx0213 (char-table-extra-slot table 0))) +(defun compose-gstring-for-variation-glyph (gstring) + "Compose glyph-string GSTRING for graphic display. +GSTRING must have two glyphs; the first is a glyph for a han character, +and the second is a glyph for a variation selector." + (let* ((font (lgstring-font gstring)) + (han (lgstring-char gstring 0)) + (vs (lgstring-char gstring 1)) + (glyphs (font-variation-glyphs font han)) + (g0 (lgstring-glyph gstring 0)) + (g1 (lgstring-glyph gstring 1))) + (catch 'tag + (dolist (elt glyphs) + (if (= (car elt) vs) + (progn + (lglyph-set-code g0 (cdr elt)) + (lglyph-set-from-to g0 (lglyph-from g0) (lglyph-to g1)) + (lgstring-set-glyph gstring 1 nil) + (throw 'tag gstring))))))) + +(let ((elt '([".." 1 compose-gstring-for-variation-glyph]))) + (set-char-table-range composition-function-table '(#xFE00 . #xFE0F) elt) + (set-char-table-range composition-function-table '(#xE0100 . #xE01EF) elt)) + (provide 'japanese) ;; arch-tag: 450f5537-9d53-4d5e-b731-4cf116d8cbc9