Add 2012 to FSF copyright years for Emacs files
[bpt/emacs.git] / lisp / language / japanese.el
index 73c3508..256263e 100644 (file)
@@ -1,9 +1,8 @@
 ;;; japanese.el --- support for Japanese -*- coding: iso-2022-7bit; no-byte-compile: t -*-
 
-;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2012  Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008
+;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 ;; Copyright (C) 2003
 
 (define-coding-system-alias 'shift_jis 'japanese-shift-jis)
 (define-coding-system-alias 'sjis 'japanese-shift-jis)
-(define-coding-system-alias 'cp932 'japanese-shift-jis)
 
 (define-coding-system 'japanese-cp932
   "CP932 (Microsoft shift-jis)"
@@ -184,7 +182,7 @@ eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>."
 (define-coding-system-alias 'euc-jisx0213 'euc-jis-2004)
 
 (define-coding-system 'japanese-shift-jis-2004
-  "Shift_JIS 8-bit encodinf for Japanese (MIME:SHIFT_JIS-2004)"
+  "Shift_JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS-2004)"
   :coding-type 'shift-jis
   :mnemonic ?S
   :charset-list '(ascii katakana-jisx0201 
@@ -250,7 +248,29 @@ eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>."
   (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
 ;;; japanese.el ends here