Mercurial > emacs
comparison lisp/international/mule-diag.el @ 95405:6c4caa612333
(describe-font): Don't check fontset
here, and just call font-info. Get the default font by from the
default face.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 30 May 2008 02:37:13 +0000 |
parents | 5d45e3ef3e0f |
children | b4f1005a6470 |
comparison
equal
deleted
inserted
replaced
95404:4bb963f7ab1a | 95405:6c4caa612333 |
---|---|
833 "Display information about a font whose name is FONTNAME. | 833 "Display information about a font whose name is FONTNAME. |
834 The font must be already used by Emacs." | 834 The font must be already used by Emacs." |
835 (interactive "sFont name (default current choice for ASCII chars): ") | 835 (interactive "sFont name (default current choice for ASCII chars): ") |
836 (or (and window-system (fboundp 'fontset-list)) | 836 (or (and window-system (fboundp 'fontset-list)) |
837 (error "No fonts being used")) | 837 (error "No fonts being used")) |
838 (let (fontset font-info) | 838 (let (font-info) |
839 (when (or (not fontname) (= (length fontname) 0)) | 839 (if (or (not fontname) (= (length fontname) 0)) |
840 (setq fontname (frame-parameter nil 'font)) | 840 (setq fontname (face-attribute 'default :font))) |
841 ;; Check if FONTNAME is a fontset. | |
842 (if (query-fontset fontname) | |
843 (setq fontset fontname | |
844 fontname (nth 1 (assq 'ascii | |
845 (aref (fontset-info fontname) 2)))))) | |
846 (setq font-info (font-info fontname)) | 841 (setq font-info (font-info fontname)) |
847 (if (null font-info) | 842 (if (null font-info) |
848 (if fontset | 843 (if (fontp fontname 'font-object) |
849 ;; The font should be surely used. So, there's some | 844 ;; The font should be surely used. So, there's some |
850 ;; problem about getting information about it. It is | 845 ;; problem about getting information about it. It is |
851 ;; better to print the fontname to show which font has | 846 ;; better to print the fontname to show which font has |
852 ;; this problem. | 847 ;; this problem. |
853 (message "No information about \"%s\"" fontname) | 848 (message "No information about \"%s\"" (font-xlfd-name fontname)) |
854 (message "No matching font being used")) | 849 (message "No matching font found")) |
855 (with-output-to-temp-buffer "*Help*" | 850 (with-output-to-temp-buffer "*Help*" |
856 (describe-font-internal font-info 'verbose))))) | 851 (describe-font-internal font-info 'verbose))))) |
857 | 852 |
858 (defun print-fontset-element (val) | 853 (defun print-fontset-element (val) |
859 ;; VAL has this format: | 854 ;; VAL has this format: |