Only init fonts once, and for any (tty/gui) session

This commit is contained in:
Henrik Lissner 2018-03-22 19:32:00 -04:00
parent 87f18bb906
commit 9f2a94c25a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -440,10 +440,8 @@ character that looks like a space that `whitespace-mode' won't affect.")
(defun doom|init-fonts (&optional frame)
"Initialize fonts."
(add-hook 'after-make-frame-functions #'doom|init-fonts)
(when (fontp doom-font)
(map-put default-frame-alist 'font (font-xlfd-name doom-font)))
(when (display-graphic-p)
(or frame (setq frame (selected-frame)))
(condition-case-unless-debug ex
(progn
@ -462,7 +460,7 @@ character that looks like a space that `whitespace-mode' won't affect.")
(font-get (caddr ex) :family))
(lwarn 'doom-ui :error
"Unexpected error while initializing fonts: %s"
(error-message-string ex)))))))
(error-message-string ex))))))
(defun doom|init-theme ()
"Set the theme and load the font, in that order."