Mercurial > emacs
comparison lisp/international/mule-util.el @ 55095:4d5ade635f7a
(char-displayable-p): Simplified by using internal-char-font.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 23 Apr 2004 02:08:22 +0000 |
parents | 4860d5ef0587 |
children | 0a99216aefaf 4c90ffeb71c5 |
comparison
equal
deleted
inserted
replaced
55094:450b41d3c078 | 55095:4d5ade635f7a |
---|---|
371 t) | 371 t) |
372 ((display-multi-font-p) | 372 ((display-multi-font-p) |
373 ;; On a window system, a character is displayable if we have | 373 ;; On a window system, a character is displayable if we have |
374 ;; a font for that character in the default face of the | 374 ;; a font for that character in the default face of the |
375 ;; currently selected frame. | 375 ;; currently selected frame. |
376 (let ((fontset (frame-parameter (selected-frame) 'font)) | 376 (car (internal-char-font nil char))) |
377 font-pattern) | |
378 (if (query-fontset fontset) | |
379 (setq font-pattern (fontset-font fontset char))) | |
380 (or font-pattern | |
381 (setq font-pattern (fontset-font "fontset-default" char))) | |
382 (if font-pattern | |
383 (progn | |
384 ;; Now FONT-PATTERN is a string or a cons of family | |
385 ;; field pattern and registry field pattern. | |
386 (or (stringp font-pattern) | |
387 (let ((family (or (car font-pattern) "*")) | |
388 (registry (or (cdr font-pattern) "*"))) | |
389 (or (string-match "-" family) | |
390 (setq family (concat "*-" family))) | |
391 (or (string-match "-" registry) | |
392 (setq registry (concat registry "-*"))) | |
393 (setq font-pattern | |
394 (format "-%s-*-*-*-*-*-*-*-*-*-*-%s" | |
395 family registry)))) | |
396 (x-list-fonts font-pattern 'default (selected-frame) 1))))) | |
397 (t | 377 (t |
398 (let ((coding (terminal-coding-system))) | 378 (let ((coding (terminal-coding-system))) |
399 (if coding | 379 (if coding |
400 (let ((safe-chars (coding-system-get coding 'safe-chars)) | 380 (let ((safe-chars (coding-system-get coding 'safe-chars)) |
401 (safe-charsets (coding-system-get coding 'safe-charsets))) | 381 (safe-charsets (coding-system-get coding 'safe-charsets))) |