[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/international/fontset.el
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/international/fontset.el |
Date: |
Tue, 29 Oct 2002 20:20:15 -0500 |
Index: emacs/lisp/international/fontset.el
diff -c emacs/lisp/international/fontset.el:1.53
emacs/lisp/international/fontset.el:1.54
*** emacs/lisp/international/fontset.el:1.53 Tue Dec 25 11:29:20 2001
--- emacs/lisp/international/fontset.el Mon Sep 30 02:41:01 2002
***************
*** 142,176 ****
(set-font-encoding "ISO8859-1" 'ascii 0)
(set-font-encoding "JISX0201" 'latin-jisx0201 0)
(define-ccl-program ccl-encode-unicode-font
`(0
! (if (r0 == ,(charset-id 'ascii))
! ((r2 = r1)
! (r1 = 0))
! (if (r0 == ,(charset-id 'latin-iso8859-1))
! ((r2 = (r1 + 128))
! (r1 = 0))
! (if (r0 == ,(charset-id 'mule-unicode-0100-24ff))
! ((r1 *= 96)
! (r1 += r2)
! (r1 += ,(- #x100 (* 32 96) 32))
! (r1 >8= 0)
! (r2 = r7))
! (if (r0 == ,(charset-id 'mule-unicode-2500-33ff))
! ((r1 *= 96)
! (r1 += r2)
! (r1 += ,(- #x2500 (* 32 96) 32))
! (r1 >8= 0)
! (r2 = r7))
! (if (r0 == ,(charset-id 'mule-unicode-e000-ffff))
! ((r1 *= 96)
! (r1 += r2)
! (r1 += ,(- #xe000 (* 32 96) 32))
! (r1 >8= 0)
! (r2 = r7)))))))))
(setq font-ccl-encoder-alist
! (cons '("ISO10646-1" . ccl-encode-unicode-font)
font-ccl-encoder-alist))
;; Setting for suppressing XLoadQueryFont on big fonts.
--- 142,211 ----
(set-font-encoding "ISO8859-1" 'ascii 0)
(set-font-encoding "JISX0201" 'latin-jisx0201 0)
+ ;; Allow display of arbitrary characters with an iso-10646-encoded
+ ;; (`Unicode') font.
+ (define-translation-table 'ucs-mule-to-mule-unicode
+ ucs-mule-to-mule-unicode)
+ (define-translation-hash-table 'ucs-mule-cjk-to-unicode
+ ucs-mule-cjk-to-unicode)
+
(define-ccl-program ccl-encode-unicode-font
`(0
! ;; r0: charset-id
! ;; r1: 1st position code
! ;; r2: 2nd position code (if r0 is 2D charset)
! ((if (r0 == ,(charset-id 'ascii))
! ((r2 = r1)
! (r1 = 0))
! ;; At first, try to get a Unicode code point directly.
! ((if (r2 >= 0)
! ;; This is a 2D charset.
! (r1 = ((r1 << 7) | r2)))
! (lookup-character ucs-mule-cjk-to-unicode r0 r1)
! (if r7
! ;; We got it!
! ((r1 = (r0 >> 8))
! (r2 = (r0 & #xFF)))
! ;; Look for a translation for non-ASCII chars.
! ((translate-character ucs-mule-to-mule-unicode r0 r1)
! (if (r0 == ,(charset-id 'latin-iso8859-1))
! ((r2 = (r1 + 128))
! (r1 = 0))
! ((r2 = (r1 & #x7F))
! (r1 >>= 7)
! (if (r0 == ,(charset-id 'mule-unicode-0100-24ff))
! ((r1 *= 96)
! (r1 += r2)
! (r1 += ,(- #x100 (* 32 96) 32))
! (r1 >8= 0)
! (r2 = r7))
! (if (r0 == ,(charset-id 'mule-unicode-2500-33ff))
! ((r1 *= 96)
! (r1 += r2)
! (r1 += ,(- #x2500 (* 32 96) 32))
! (r1 >8= 0)
! (r2 = r7))
! (if (r0 == ,(charset-id 'mule-unicode-e000-ffff))
! ((r1 *= 96)
! (r1 += r2)
! (r1 += ,(- #xe000 (* 32 96) 32))
! (r1 >8= 0)
! (r2 = r7))
! ;; No way, use the glyph for U+FFFD.
! ((r1 = #xFF)
! (r2 = #xFD)))))))))))))
! "Encode characters for display with iso10646 font.
! Translate through the translation-hash-table named
! `ucs-mule-cjk-to-unicode' and the translation-table named
! `ucs-mule-to-mule-unicode' initially.")
+ ;; Use the above CCL encoder for Unicode fonts. Please note that the
+ ;; regexp is not simply "ISO10646-1" because there exists, for
+ ;; instance, the following Devanagari Unicode fonts:
+ ;; -misc-fixed-medium-r-normal--24-240-72-72-c-120-iso10646.indian-1
+ ;; -sibal-devanagari-medium-r-normal--24-240-75-75-P--iso10646-dev
(setq font-ccl-encoder-alist
! (cons '("ISO10646.*-*" . ccl-encode-unicode-font)
font-ccl-encoder-alist))
;; Setting for suppressing XLoadQueryFont on big fonts.