From 19203a91a3252f50aa01be987714174c59652f20 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 4 Jun 2021 01:35:59 -0400 Subject: [PATCH] Unset :weight, :slant, :width on font faces Setting a face's `:font` attribute implicitly sets a host of other faces attributes (:family, :foundry, :width, :weight, :height, and :slant), which is problematic in places where these faces are used in tandem with other faces, like how EWW renders bold elements with both variable-pitch+bold faces, with the expectation that their attributes would cascade properly, but not so if variable-pitch sets :weight or :slant. --- core/core-ui.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index bb0b25c54..ee961b3f9 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -584,12 +584,13 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (when doom-unicode-font (set-fontset-font t 'unicode doom-unicode-font)))) (apply #'custom-set-faces - (append (when doom-font - `((fixed-pitch ((t (:font ,doom-font)))))) - (when doom-serif-font - `((fixed-pitch-serif ((t (:font ,doom-serif-font)))))) - (when doom-variable-pitch-font - `((variable-pitch ((t (:font ,doom-variable-pitch-font)))))))) + (let ((attrs '(:weight unspecified :slant unspecified :width unspecified))) + (append (when doom-font + `((fixed-pitch ((t (:font ,doom-font ,@attrs)))))) + (when doom-serif-font + `((fixed-pitch-serif ((t (:font ,doom-serif-font ,@attrs)))))) + (when doom-variable-pitch-font + `((variable-pitch ((t (:font ,doom-variable-pitch-font ,@attrs))))))))) ;; Never save these settings to `custom-file' (dolist (sym '(fixed-pitch fixed-pitch-serif variable-pitch)) (put sym 'saved-face nil))