From bac79657a5dac12776a5e0f2c2af8ae51dc618cd Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 9 Apr 2021 12:48:54 -0500 Subject: Change font loading logic to hopefully be more robust Based heavily (basically copied) from https://github.com/olivertaylor/olivertaylor.github.io/blob/master/notes/20210324_emacs-optical-font-adjustment.org --- early-init.el | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'early-init.el') diff --git a/early-init.el b/early-init.el index 53059cd..8515fa9 100644 --- a/early-init.el +++ b/early-init.el @@ -72,19 +72,18 @@ (add-function :after after-focus-change-function (defun hook--setup-fonts () - (dolist (face '(default fixed-pitch)) - ;; `default' and `fixed-pitch' should be the same. - (set-face-attribute face nil - :font (pcase acdw/system - (:home "DejaVu Sans Mono-10") - (:work "Consolas-10") - (:other "monospace-10")))) - ;; `variable-pitch' is, of course, different. - (set-face-attribute 'variable-pitch nil - :font (pcase acdw/system + (require 'acdw-fonts) + (setq acdw-fonts/monospace (pcase acdw/system + (:home "DejaVu Sans Mono") + (:work "Consolas") + (:other "monospace")) + acdw-fonts/monospace-size 10 + acdw-fonts/variable (pcase acdw/system (:home "DejaVu Sans") - (:work "Calibri-11") - (:other "sans-serif"))) + (:work "Calibri") + (:other "sans-serif")) + acdw-fonts/variable-size 11) + (acdw-fonts/set) (remove-function after-focus-change-function 'hook--setup-fonts))) -- cgit 1.4.1-21-gabe81