Skip to content

Commit

Permalink
emacs: explicitly set font size (#553)
Browse files Browse the repository at this point in the history
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.

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
  • Loading branch information
jezcope committed Sep 12, 2024
1 parent ef81ad9 commit 35233f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/emacs/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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}))
Expand Down

0 comments on commit 35233f9

Please sign in to comment.