~ubuntu-branches/ubuntu/karmic/emacs-snapshot/karmic

« back to all changes in this revision

Viewing changes to lisp/language/japanese.el

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-04-05 09:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090405091430-nw07lynn2arotjbe
Tags: upstream-20090320
ImportĀ upstreamĀ versionĀ 20090320

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;; japanese.el --- support for Japanese -*- coding: iso-2022-7bit; no-byte-compile: t -*-
2
2
 
3
 
;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 
3
;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4
4
;;   Free Software Foundation, Inc.
5
5
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
6
 
;;   2005, 2006, 2007, 2008
 
6
;;   2005, 2006, 2007, 2008, 2009
7
7
;;   National Institute of Advanced Industrial Science and Technology (AIST)
8
8
;;   Registration Number H14PRO021
9
9
;; Copyright (C) 2003
250
250
  (define-translation-table 'unicode-to-jisx0213
251
251
    (char-table-extra-slot table 0)))
252
252
 
 
253
(defun compose-gstring-for-variation-glyph (gstring)
 
254
  "Compose glyph-string GSTRING for graphic display.
 
255
GSTRING must have two glyphs; the first is a glyph for a han character,
 
256
and the second is a glyph for a variation selector."
 
257
  (let* ((font (lgstring-font gstring))
 
258
         (han (lgstring-char gstring 0))
 
259
         (vs (lgstring-char gstring 1))
 
260
         (glyphs (font-variation-glyphs font han))
 
261
         (g0 (lgstring-glyph gstring 0))
 
262
         (g1 (lgstring-glyph gstring 1)))
 
263
    (catch 'tag
 
264
      (dolist (elt glyphs)
 
265
        (if (= (car elt) vs)
 
266
            (progn
 
267
              (lglyph-set-code g0 (cdr elt))
 
268
              (lglyph-set-from-to g0 (lglyph-from g0) (lglyph-to g1))
 
269
              (lgstring-set-glyph gstring 1 nil)
 
270
              (throw 'tag gstring)))))))
 
271
 
 
272
(let ((elt '([".." 1 compose-gstring-for-variation-glyph])))
 
273
  (set-char-table-range composition-function-table '(#xFE00 . #xFE0F) elt)
 
274
  (set-char-table-range composition-function-table '(#xE0100 . #xE01EF) elt))
 
275
 
253
276
(provide 'japanese)
254
277
 
255
278
;; arch-tag: 450f5537-9d53-4d5e-b731-4cf116d8cbc9