emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/language japanese.el


From: Kenichi Handa
Subject: [Emacs-diffs] emacs/lisp/language japanese.el
Date: Tue, 30 Dec 2008 23:34:21 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/12/30 23:34:21

Modified files:
        lisp/language  : japanese.el 

Log message:
        (compose-gstring-for-variation-glyph): New
        function.  Register it in composition-function-table.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/language/japanese.el?cvsroot=emacs&r1=1.45&r2=1.46

Patches:
Index: japanese.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/language/japanese.el,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- japanese.el 14 May 2008 01:54:09 -0000      1.45
+++ japanese.el 30 Dec 2008 23:34:21 -0000      1.46
@@ -250,6 +250,29 @@
   (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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]