From e8589cec6ca1048b4771be5dbea6323b7f87df9b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 31 Jan 2022 00:53:30 -0600 Subject: [PATCH] Change face-setting logic --- early-init.el | 13 ------------- lisp/acdw.el | 8 ++++++++ machines/bob.el | 8 ++++++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/early-init.el b/early-init.el index 8ceb74f..137c04c 100644 --- a/early-init.el +++ b/early-init.el @@ -76,19 +76,6 @@ See `no-littering' for examples.") ;;; Fonts (+with-ensure-after-init - (unless noninteractive ;; Set default faces - (+with-message "Setting default faces" - (let ((font-name machine-default-font) - (font-size machine-default-height) - (variable-font-name machine-variable-pitch-font) - (variable-font-size machine-variable-pitch-height)) - (set-face-attribute 'default nil :family font-name - :height font-size :weight 'book) - (set-face-attribute 'italic nil :family font-name - :height font-size :slant 'italic) - (set-face-attribute 'variable-pitch nil :family variable-font-name - :height variable-font-size)))) - ;; Emoji fonts (+with-message "Adding emoji fonts" (let ((ffl (font-family-list))) diff --git a/lisp/acdw.el b/lisp/acdw.el index c2f9767..916591c 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -259,5 +259,13 @@ Use like `setq'." into ret finally return ret))) +(defun +set-faces (specs) + "Set fonts to SPECS. +Specs is an alist: its cars are faces and its cdrs are the plist +passed to `set-face-attribute'. Note that the FRAME argument is +always nil; this function is mostly intended for use in init." + (dolist (spec specs) + (apply #'set-face-attribute (car spec) nil (cdr spec)))) + (provide 'acdw) ;;; acdw.el ends here diff --git a/machines/bob.el b/machines/bob.el index e9b444c..37831db 100644 --- a/machines/bob.el +++ b/machines/bob.el @@ -4,7 +4,11 @@ ;;; Code: -(setq machine-default-font "DejaVu Sans Mono" - machine-default-height 105) +(require 'acdw) + +(+set-faces `((default :family "CMU Typewriter Text" + :height 120) + (variable-pitch :family "CMU Typewriter Text Variable Width" + :height 1.1))) ;;; bob.el ends here