86
|
1 ;;; char-table.el --- display table of charset
|
|
2
|
|
3 ;; Copyright (C) 1996,1997 MORIOKA Tomohiko
|
|
4
|
|
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
|
98
|
6 ;; Version: $Id: char-table.el,v 1.2 1997/02/15 22:21:24 steve Exp $
|
86
|
7 ;; Keywords: character, Emacs/mule
|
|
8
|
|
9 ;; This file is not part of tl (Tiny Library).
|
|
10
|
|
11 ;; This program is free software; you can redistribute it and/or
|
|
12 ;; modify it under the terms of the GNU General Public License as
|
|
13 ;; published by the Free Software Foundation; either version 2, or (at
|
|
14 ;; your option) any later version.
|
|
15
|
|
16 ;; This program is distributed in the hope that it will be useful, but
|
|
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
19 ;; General Public License for more details.
|
|
20
|
|
21 ;; You should have received a copy of the GNU General Public License
|
|
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
24 ;; Boston, MA 02111-1307, USA.
|
|
25
|
|
26 ;;; Code:
|
|
27
|
|
28 (defun char-position-to-string (charset r l &optional plane)
|
|
29 (char-to-string
|
|
30 (if plane
|
98
|
31 (make-char charset plane (+ (* r 16) l))
|
|
32 (make-char charset (+ (* r 16) l))
|
86
|
33 )))
|
|
34
|
|
35 (defun char-table-1 (charset r l plane)
|
|
36 (let ((str (char-position-to-string charset r l plane)))
|
|
37 (concat
|
|
38 (let ((i 0)
|
|
39 (len (- 3 (string-columns str)))
|
|
40 (dest ""))
|
|
41 (while (< i len)
|
|
42 (setq dest (concat dest " "))
|
|
43 (setq i (1+ i))
|
|
44 )
|
|
45 dest) str)))
|
|
46
|
|
47 (defun show-94-table (charset &optional plane ofs)
|
|
48 (if (null ofs)
|
|
49 (setq ofs 0)
|
|
50 )
|
|
51 (princ "======================================================\n")
|
|
52 (princ (format
|
|
53 "[%3x]: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"
|
|
54 (or plane 0)))
|
|
55 (princ "-----+------------------------------------------------\n")
|
|
56 (let ((j 2))
|
|
57 (princ (format "%2x%x : " (or plane 0) (* (+ j ofs) 16)))
|
|
58 (let ((k 1))
|
|
59 (while (< k 16)
|
|
60 (princ (char-table-1 charset j k plane))
|
|
61 (setq k (+ k 1))
|
|
62 )
|
|
63 (princ "\n")
|
|
64 )
|
|
65 (setq j 3)
|
|
66 (while (< j 7)
|
|
67 (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
|
|
68 (let ((k 0))
|
|
69 (while (< k 16)
|
|
70 (princ (char-table-1 charset j k plane))
|
|
71 (setq k (+ k 1))
|
|
72 )
|
|
73 (princ "\n")
|
|
74 )
|
|
75 (setq j (+ j 1))
|
|
76 )
|
|
77 (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
|
|
78 (let ((k 0))
|
|
79 (while (< k 15)
|
|
80 (princ (char-table-1 charset j k plane))
|
|
81 (setq k (+ k 1))
|
|
82 )
|
|
83 (princ "\n")
|
|
84 )
|
|
85 ))
|
|
86
|
|
87 (defun show-96-table (charset &optional plane ofs)
|
|
88 (if (null ofs)
|
|
89 (setq ofs 0)
|
|
90 )
|
|
91 (princ "======================================================\n")
|
|
92 (princ (format
|
|
93 "[%3x]: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"
|
|
94 (or plane 0)))
|
|
95 (princ "-----+------------------------------------------------\n")
|
|
96 (let ((j 2))
|
|
97 (while (< j 8)
|
|
98 (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
|
|
99 (let ((k 0))
|
|
100 (while (< k 16)
|
|
101 (princ (char-table-1 charset j k plane))
|
|
102 (setq k (+ k 1))
|
|
103 )
|
|
104 (princ "\n")
|
|
105 )
|
|
106 (setq j (1+ j))
|
|
107 )))
|
|
108
|
|
109 (defun show-94x94-table (charset)
|
|
110 (let ((i 33))
|
|
111 (while (< i 127)
|
|
112 (show-94-table charset i)
|
|
113 (setq i (1+ i))
|
|
114 )))
|
|
115
|
|
116 (defun show-96x96-table (charset)
|
|
117 (let ((i 32))
|
|
118 (while (< i 128)
|
|
119 (show-96-table charset i)
|
|
120 (setq i (1+ i))
|
|
121 )))
|
|
122
|
|
123 (defun show-char-table (charset)
|
|
124 (let ((cc (charset-chars charset))
|
|
125 (cd (charset-dimension charset))
|
|
126 )
|
|
127 (cond ((= cd 1)
|
|
128 (cond ((= cc 94)
|
|
129 (show-94-table charset)
|
|
130 )
|
|
131 ((= cc 96)
|
|
132 (show-96-table charset)
|
|
133 ))
|
|
134 )
|
|
135 ((= cd 2)
|
|
136 (cond ((= cc 94)
|
|
137 (show-94x94-table charset)
|
|
138 )
|
|
139 ((= cc 96)
|
|
140 (show-96x96-table charset)
|
|
141 ))
|
|
142 ))))
|
|
143
|
|
144
|
|
145 ;;; @ end
|
|
146 ;;;
|
|
147
|
|
148 (provide 'char-table)
|
|
149
|
|
150 ;;; char-table.el ends here
|