Structure font setting code a little better

This commit is contained in:
Nathan McCarty 2023-03-30 20:07:53 -04:00
parent 9b80622cfe
commit c75ab37f5a
No known key found for this signature in database
1 changed files with 15 additions and 12 deletions

View File

@ -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