From b3510cd82299aae59e1f7cf28448979cc7f8a3bf Mon Sep 17 00:00:00 2001 From: Jez Cope Date: Wed, 11 Sep 2024 10:51:04 +0100 Subject: [PATCH] emacs: explicitly set font size The emacs module currently doesn't set the font size, only the colours and font family. This PR sets it to `sizes.terminal` (taking a lead from the `guifont` setting in the `vim` module) using `font-spec`, which is a more flexible way to specify fonts in elisp. To indicate the size is points it needs to be a floating point value. --- modules/emacs/hm.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/emacs/hm.nix b/modules/emacs/hm.nix index 665e0a32..fe79eb77 100644 --- a/modules/emacs/hm.nix +++ b/modules/emacs/hm.nix @@ -5,6 +5,7 @@ with config.stylix.fonts; let emacsOpacity = builtins.toString (builtins.ceil (config.stylix.opacity.applications * 100)); + emacsSize = builtins.toString (sizes.terminal * 1.0); in { options.stylix.targets.emacs.enable = @@ -65,7 +66,7 @@ in (setq base16-theme-256-color-source 'colors) (load-theme 'base16-stylix t) ;; Set font - (set-face-attribute 'default t :font "${monospace.name}" ) + (set-face-attribute 'default t :font (font-spec :family "${monospace.name}" :size "${emacsSize}")) ;; ----------------------------- ;; set opacity (add-to-list 'default-frame-alist '(alpha-background . ${emacsOpacity}))