Better error-handling for missing fonts #301

This commit is contained in:
Henrik Lissner 2017-12-22 17:10:13 -05:00
parent 3bbb78f779
commit d57d0d9305
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -182,9 +182,13 @@ local value, whether or not it's permanent-local. Therefore, we cycle
(when (fontp doom-variable-pitch-font)
(set-face-attribute 'variable-pitch frame :font doom-variable-pitch-font)))
('error
(if (string-prefix-p "Font not available: " (error-message-string ex))
(lwarn 'doom-ui :warning
"Could not find the '%s' font on your system, falling back to system font"
(font-get (caddr ex) :family))
(lwarn 'doom-ui :error
"Failed to set fonts because %s"
(error-message-string ex))))
"Unexpected error while initializing fonts: %s"
(error-message-string ex)))))
(run-hooks 'doom-init-ui-hook))
(defun doom|reload-ui-in-daemon (frame)