Created
May 9, 2019 09:48
-
-
Save emres/917ffc60f4fe209a6a1bad6b3abd4fa1 to your computer and use it in GitHub Desktop.
Print the same string of text in all the available fixed width (mono spaced) fonts in a new Emacs buffer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; See the following for more details | |
;; https://emacs.stackexchange.com/a/50215/8887 | |
;; and also see the following on a recent GNU/Linux or similar system: | |
;; /usr/share/doc/fontconfig/fontconfig-user.html | |
;; for the explanation of spacing=100 | |
;; also see the following UNIX StackExchange answer: | |
;; https://unix.stackexchange.com/a/363368/13105 | |
(defun compare-monospace-font-families () | |
"Display a list of all monospace font faces. Tested on GNU/Linux." | |
(interactive) | |
(pop-to-buffer "*Monospace Fonts*") | |
(erase-buffer) | |
(dolist (font-name (seq-filter (lambda (font) | |
(when-let ((info (font-info font))) | |
(string-match-p "spacing=100" (aref info 1)))) | |
(font-family-list))) | |
(insert | |
(propertize | |
(concat "1 l; 0 O o [ < = > ] " font-name ")\n") | |
'font-lock-face `((:family | |
,(format "%s" (font-get (font-spec :name font-name) :family)))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment