;; you have to do this twice the first time, and sometimes after that if
;; you've run it in another buffer. I think the variable
;; `buffer-face-mode-face' isn't behaving quite buffer-locally
(defun gpc/toggle-proportional-font ()
"Switch between my default proportional and monospace
typefaces."
(interactive)
(let* ((family (if (boundp 'buffer-face-mode-face)
(plist-get buffer-face-mode-face :family)
gpc/default-font))
(new-family (if (string-equal family gpc/proportional-font)
gpc/monospace-font
gpc/proportional-font)))
(message "Set font to %s" new-family)
(setq buffer-face-mode-face `(:family ,new-family))
(buffer-face-mode t)))
Before that, I would have been physically unable to not download and test drive the OP's font.
Of course, I bound C-S-M-SPC to toggle back to monospace when needed.
(setq gpc/proportional-font "Verdana") (setq gpc/monospace-font "Source Code Pro") (setq gpc/default-font gpc/proportional-font)
;; you have to do this twice the first time, and sometimes after that if ;; you've run it in another buffer. I think the variable ;; `buffer-face-mode-face' isn't behaving quite buffer-locally (defun gpc/toggle-proportional-font () "Switch between my default proportional and monospace typefaces." (interactive) (let* ((family (if (boundp 'buffer-face-mode-face) (plist-get buffer-face-mode-face :family) gpc/default-font)) (new-family (if (string-equal family gpc/proportional-font) gpc/monospace-font gpc/proportional-font))) (message "Set font to %s" new-family) (setq buffer-face-mode-face `(:family ,new-family)) (buffer-face-mode t)))