Mercurial > emacs
comparison lisp/international/mule-diag.el @ 89713:dd442ee53657
(stretches-for-character-list): Delete it.
(list-block-of-chars): Use tabs instead of `display' property for
aligning characters.
(print-fontset-element): Fix the printing of XLFD.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 15 Jan 2004 23:03:32 +0000 |
parents | bc83bb07e632 |
children | 694e157b2143 |
comparison
equal
deleted
inserted
replaced
89712:37b673654269 | 89713:dd442ee53657 |
---|---|
231 nil t initial-input 'charset-history | 231 nil t initial-input 'charset-history |
232 default-value))) | 232 default-value))) |
233 (if (> (length charset) 0) | 233 (if (> (length charset) 0) |
234 (intern charset)))) | 234 (intern charset)))) |
235 | 235 |
236 ;; Vector of 16 space-only strings. Nth string has display property | |
237 ;; '(space :align-to COL) when COL is the column number to align the | |
238 ;; Nth character in a row. Used by `list-block-of-chars'. | |
239 | |
240 (defconst stretches-for-character-list | |
241 (let ((stretches (make-vector 16 nil))) | |
242 (dotimes (i 16) | |
243 (aset stretches i | |
244 (propertize " " 'display `(space :align-to ,(+ 6 (* i 4)))))) | |
245 stretches) | |
246 "For internal use only.") | |
247 | |
248 ;; List characters of the range MIN and MAX of CHARSET. If dimension | 236 ;; List characters of the range MIN and MAX of CHARSET. If dimension |
249 ;; of CHARSET is two (i.e. 2-byte charset), ROW is the first byte | 237 ;; of CHARSET is two (i.e. 2-byte charset), ROW is the first byte |
250 ;; (block index) of the characters, and MIN and MAX are the second | 238 ;; (block index) of the characters, and MIN and MAX are the second |
251 ;; bytes of the characters. If the dimension is one, ROW should be 0. | 239 ;; bytes of the characters. If the dimension is one, ROW should be 0. |
252 | 240 |
253 (defun list-block-of-chars (charset row min max) | 241 (defun list-block-of-chars (charset row min max) |
254 (let (i ch) | 242 (let (i ch) |
255 (insert-char ?- (+ 5 (* 4 16))) | 243 (insert-char ?- (+ 7 (* 4 16))) |
256 (insert "\n ") | 244 (insert "\n ") |
257 (setq i 0) | 245 (setq i 0) |
258 (while (< i 16) | 246 (while (< i 16) |
259 (insert (format "%4X" i)) | 247 (insert (format "%4X" i)) |
260 (setq i (1+ i))) | 248 (setq i (1+ i))) |
261 (setq i (* (/ min 16) 16)) | 249 (setq i (* (/ min 16) 16)) |
262 (while (<= i max) | 250 (while (<= i max) |
263 (if (= (% i 16) 0) | 251 (if (= (% i 16) 0) |
264 (insert (format "\n%4Xx" (/ (+ (* row 256) i) 16)))) | 252 (insert (format "\n%6Xx" (/ (+ (* row 256) i) 16)))) |
265 (setq ch (if (< i min) | 253 (setq ch (if (< i min) |
266 32 | 254 32 |
267 (or (decode-char charset (+ (* row 256) i)) | 255 (or (decode-char charset (+ (* row 256) i)) |
268 32))) ; gap in mapping | 256 32))) ; gap in mapping |
269 ;; Don't insert a control code. | 257 ;; Don't insert a control code. |
270 (if (or (< ch 32) (= ch 127)) | 258 (if (or (< ch 32) (= ch 127)) |
271 (setq ch (single-key-description ch)) | 259 (setq ch (single-key-description ch)) |
272 (if (and (>= ch 128) (< ch 160)) | 260 (if (and (>= ch 128) (< ch 160)) |
273 (setq ch (format "%02Xh" ch)))) | 261 (setq ch (format "%02Xh" ch)))) |
274 (insert (aref stretches-for-character-list (% i 16)) ch) | 262 (insert "\t" ch) |
275 (setq i (1+ i)))) | 263 (setq i (1+ i)))) |
276 (insert "\n")) | 264 (insert "\n")) |
277 | 265 |
278 ;;;###autoload | 266 ;;;###autoload |
279 (defun list-charset-chars (charset) | 267 (defun list-charset-chars (charset) |
289 (let ((slot (memq 'mode-line-buffer-identification mode-line-format))) | 277 (let ((slot (memq 'mode-line-buffer-identification mode-line-format))) |
290 (if slot | 278 (if slot |
291 (setcdr slot | 279 (setcdr slot |
292 (cons (format " (%s)" charset) | 280 (cons (format " (%s)" charset) |
293 (cdr slot))))) | 281 (cdr slot))))) |
294 (setq indent-tabs-mode nil) | 282 (setq tab-width 4) |
295 (set-buffer-multibyte t) | 283 (set-buffer-multibyte t) |
296 (unless (charsetp charset) | 284 (unless (charsetp charset) |
297 (error "Invalid character set %s" charset)) | 285 (error "Invalid character set %s" charset)) |
298 (let ((dim (charset-dimension charset)) | 286 (let ((dim (charset-dimension charset)) |
299 (chars (charset-chars charset)) | 287 (chars (charset-chars charset)) |
885 (= (aref registry (1- (length registry))) ?*) | 873 (= (aref registry (1- (length registry))) ?*) |
886 (setq registry (concat registry "*"))) | 874 (setq registry (concat registry "*"))) |
887 (insert "\n -" family | 875 (insert "\n -" family |
888 ?- (or (aref requested 1) ?*) ; weight | 876 ?- (or (aref requested 1) ?*) ; weight |
889 ?- (or (aref requested 2) ?*) ; slant | 877 ?- (or (aref requested 2) ?*) ; slant |
890 "-*-" (or (aref requested 3) ?*) ; width | 878 ?- (or (aref requested 3) ?*) ; width |
891 "-*-" (or (aref requested 4) ?*) ; adstyle | 879 ?- (or (aref requested 4) ?*) ; adstyle |
892 "-*-*-*-*-*-*-" registry)))) | 880 "-*-*-*-*-*-*-" registry)))) |
893 | 881 |
894 ;; Insert opened font names (if any). | 882 ;; Insert opened font names (if any). |
895 (if (and (boundp 'print-opened) (symbol-value 'print-opened)) | 883 (if (and (boundp 'print-opened) (symbol-value 'print-opened)) |
896 (dolist (opened (cdr elt)) | 884 (dolist (opened (cdr elt)) |