Function: print-fontset

print-fontset is a byte-compiled function defined in mule-diag.el.gz.

Signature

(print-fontset FONTSET &optional PRINT-OPENED)

Documentation

Print information about FONTSET.

FONTSET nil means the fontset of the selected frame, t means the default fontset. If optional arg PRINT-OPENED is non-nil, also print names of all opened fonts for FONTSET. This function actually inserts the information in the current buffer.

Probably introduced at or before Emacs version 23.1.

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule-diag.el.gz
(defun print-fontset (fontset &optional print-opened)
  "Print information about FONTSET.
FONTSET nil means the fontset of the selected frame, t means the
default fontset.
If optional arg PRINT-OPENED is non-nil, also print names of all opened
fonts for FONTSET.  This function actually inserts the information in
the current buffer."
  (if (eq fontset t)
      (setq fontset (query-fontset "fontset-default"))
    (if (eq fontset nil)
	(setq fontset (face-attribute 'default :fontset))))
  (beginning-of-line)
  (narrow-to-region (point) (point))
  (insert "Fontset: " fontset "\n")
  (insert (propertize "CHAR RANGE" 'face 'underline)
	   " (" (propertize "CODE RANGE" 'face 'underline) ")\n")
  (insert "    " (propertize "FONT NAME" 'face 'underline)
	  " (" (propertize "REQUESTED" 'face 'underline)
	  " and [" (propertize "OPENED" 'face 'underline) "])")
  (let* ((info (fontset-info fontset))
	 (default-info (char-table-extra-slot info 0))
	 (mule--print-opened print-opened)
	 start1 end1 start2 end2)
    (describe-vector info #'print-fontset-element)
    (when (char-table-range info nil)
      ;; The default of FONTSET is described.
      (setq start1 (re-search-backward "^default"))
      (delete-region (point) (line-end-position))
      (insert "\n  ---<fallback to the default of the specified fontset>---")
      (put-text-property (line-beginning-position) (point) 'face 'highlight)
      (goto-char (point-max))
      (setq end1 (setq start2 (point))))
    (when default-info
      (insert "\n  ---<fallback to the default fontset>---")
      (put-text-property (line-beginning-position) (point) 'face 'highlight)
      (describe-vector default-info #'print-fontset-element)
      (when (char-table-range default-info nil)
	;; The default of the default fontset is described.
	(setq end2 (re-search-backward "^default"))
	(delete-region (point) (line-end-position))
	(insert "\n  ---<fallback to the default of the default fontset>---")
	(put-text-property (line-beginning-position) (point) 'face 'highlight)))
      (if (and start1 end2)
	  ;; Reorder the printed information to match with the font
	  ;; searching strategy; i.e. FONTSET, the default fontset,
	  ;; default of FONTSET, default of the default fontset.
	  (transpose-regions start1 end1 start2 end2))
      (goto-char (point-max)))
  (widen))