Function: describe-font

describe-font is an autoloaded, interactive and byte-compiled function defined in mule-diag.el.gz.

Signature

(describe-font FONTNAME)

Documentation

Display information about a font whose name is FONTNAME.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule-diag.el.gz
;;;###autoload
(defun describe-font (fontname)
  "Display information about a font whose name is FONTNAME."
  (interactive
   (list (completing-read
          "Font name (default current choice for ASCII chars): "
          (and window-system
               ;; Implied by `window-system'.
               (fboundp 'x-list-fonts)
               (fboundp 'fontset-list)
               ;; The final element in `fontset-list' is a default
               ;; (generic) one, so don't include that.
               (nconc (butlast (fontset-list))
                      (x-list-fonts "*"))))))
  (or (and window-system (fboundp 'fontset-list))
      (error "No fonts being used"))
  (let ((xref-item (list #'describe-font fontname))
        font-info)
    (if (or (not fontname) (= (length fontname) 0))
	(setq fontname (face-attribute 'default :font)))
    (setq font-info (font-info fontname))
    (if (null font-info)
	(if (fontp fontname 'font-object)
	    ;; If there's some problem with getting information about
	    ;; the font, print the font name to show which font has
	    ;; this problem.
	    (message "No information about \"%s\"" (font-xlfd-name fontname))
	  (message "No matching font found"))
      (help-setup-xref xref-item (called-interactively-p 'interactive))
      (with-output-to-temp-buffer "*Help*"
	(describe-font-internal font-info)))))