From c75ab37f5a84e0b65e823e812577348d6aa10909 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Thu, 30 Mar 2023 20:07:53 -0400 Subject: [PATCH] Structure font setting code a little better --- config.org | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/config.org b/config.org index 3ef5d6d..85c0326 100644 --- a/config.org +++ b/config.org @@ -31,18 +31,21 @@ The provided default ~config.el~ ;; ;; See 'C-h v doom-font' for documentation and more examples of what they ;; accept. For example: -;; -(if (string= (system-name) "wsl") - (setq doom-font (font-spec :family "Iosevka" :size 16 :weight 'semi-light) - doom-unicode-font (font-spec :family "Iosevka" :size 16 :weight 'semi-light) - doom-variable-pitch-font (font-spec :family "Iosevka Sans Quasi" :size 19)) - (if (string= (system-name) "extremophile") - (setq doom-font (font-spec :family "Iosevka Nerd Font" :size 11 :weight 'semi-light) - doom-unicode-font (font-spec :family "Iosevka Nerd Font" :size 11 :weight 'semi-light) - doom-variable-pitch-font (font-spec :family "Iosevka Sans Quasi" :size 13)) - (setq doom-font (font-spec :family "Iosevka" :size 13 :weight 'semi-light) - doom-unicode-font (font-spec :family "Iosevka" :size 13 :weight 'semi-light) - doom-variable-pitch-font (font-spec :family "Iosevka Sans Quasi" :size 15)))) + +;; Figure out what the name and size of the font are going to be based on the system type and +;; hostname +(let ((nm/font-name (cond ((eq system-type 'darwin) "Iosevka Nerd Font") + (t "Iosevka"))) + (nm/font-size (cond ((eq system-type 'darwin) 11) + ((string= (system-name) "wsl") 16) + (t 13))) + (nm/variable-font-size (cond ((eq system-type 'darwin) 13) + ((string= (system-name) "wsl") 19) + (t 15)))) + (setq doom-font (font-spec :family nm/font-name :size nm/font-size :weight 'semi-light) + doom-unicode-font (font-spec :family nm/font-name :size nm/font-size :weight 'semi-light) + doom-variable-pitch-font (font-spec :family "Iosevka Sans Quasi" :size nm/variable-font-size))) + ;; ;; If you or Emacs can't find your font, use 'M-x describe-font' to look them ;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to