-;;; japanese.el --- support for Japanese -*- coding: iso-2022-7bit; no-byte-compile: t -*-
+;;; japanese.el --- support for Japanese -*- coding: iso-2022-7bit -*-
-;; 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
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(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)"
(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
(set-language-info-alist
"Japanese" '((setup-function . setup-japanese-environment-internal)
(exit-function . use-default-char-width-table)
+ (iso639-language . ja)
(tutorial . "TUTORIAL.ja")
(charset japanese-jisx0208
japanese-jisx0212 latin-jisx0201 katakana-jisx0201
(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