From 2908a6389e3a9c427cbc35a5f70ef19ec01fd71e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 14 Jun 2018 13:59:04 +0200 Subject: [PATCH] Fix font loading in daemon-spawned frames set-face-attribute wasn't reliable for changing the fixed-pitch and variable-pitch faces. custom-set-faces uses a custom, internal user theme that has the highest precedence, making this the superior choice for default font-setting. --- core/core-ui.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index 4ad92a1a2..a185d6b37 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -555,16 +555,16 @@ frame's window-system, the theme will be reloaded.") "Initialize fonts." (condition-case-unless-debug ex (progn - (when (fontp doom-font) - (map-put default-frame-alist 'font (font-xlfd-name doom-font)) - (set-face-attribute 'fixed-pitch nil :font doom-font)) + (custom-set-faces + (when (fontp doom-font) + (map-put default-frame-alist 'font (font-xlfd-name doom-font)) + `(fixed-pitch ((t (:font ,doom-font))))) + (when (fontp doom-variable-pitch-font) + `(variable-pitch ((t (:font ,doom-variable-pitch-font)))))) ;; Fallback to `doom-unicode-font' for Unicode characters (when (fontp doom-unicode-font) (setq use-default-font-for-symbols nil) - (set-fontset-font t 'unicode doom-unicode-font nil)) - ;; ...and for variable-pitch-mode: - (when (fontp doom-variable-pitch-font) - (set-face-attribute 'variable-pitch nil :font doom-variable-pitch-font))) + (set-fontset-font t 'unicode doom-unicode-font nil))) ('error (if (string-prefix-p "Font not available: " (error-message-string ex)) (lwarn 'doom-ui :warning