Created
May 9, 2019 09:50
-
-
Save emres/a36642f497f10c134f1e704b56d81e67 to your computer and use it in GitHub Desktop.
Compare mono spaced fonts in MS Windows by printing the same string of text in all of them
This file contains 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 also: | |
;; https://gist.github.com/emres/917ffc60f4fe209a6a1bad6b3abd4fa1 | |
(defun font-is-mono-p (font-name) | |
(string-match "-mono-" font-name)) | |
(defun compare-monospace-fonts () | |
"Display a list of all monospace font faces. Tested on MS Windows 10." | |
(interactive) | |
(pop-to-buffer "*Monospace Fonts*") | |
(erase-buffer) | |
(dolist (font-name (x-list-fonts "*")) | |
(if (and (font-is-mono-p font-name) | |
(ignore-errors (font-spec :name font-name))) | |
(progn | |
(newline) | |
(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))) | |
(:font (font-spec :name font-name))))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment