home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

commit 0661b9bfdf7b8f098fa31d7b831438393665e984
parent 7e25be8dddcf1181dcaf381c157d2db9f63601fd
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Mon, 13 May 2024 10:23:43 +0200

tools/emacs: trying out a new font: Cascadia Mono

I've been using Ubuntu Mono for… more than a decade, but for some
reason, I think I do like Cascadia Mono… At least trying for a change.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mtools/emacs/config/config-appearance.el | 6++++--
Mtools/emacs/early-init.el | 10+++++++---
Mtools/emacs/init.el | 15+++++++++++++++
3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/tools/emacs/config/config-appearance.el b/tools/emacs/config/config-appearance.el @@ -37,9 +37,11 @@ :bind (("C-c f s" . fontaine-set-preset) ("C-c f S" . fontaine-set-face-font)) :init + ;; Test with cascadi code/cascadia mono + ;; Use some global constant (from `early-init.el') (setq fontaine-presets '((small - :default-family "UbuntuMono Nerd Font" + :default-family font-family-mono :default-height 110 :variable-pitch-family "Ubuntu Nerd Font") (regular) ; like this it uses all the fallback values and is named `regular' @@ -58,7 +60,7 @@ ;; I keep all properties for didactic purposes, but most can be ;; omitted. See the fontaine manual for the technicalities: ;; <https://protesilaos.com/emacs/fontaine>. - :default-family "UbuntuMono Nerd Font" + :default-family font-family-mono :default-weight regular :default-height 130 :fixed-pitch-family nil ; falls back to :default-family diff --git a/tools/emacs/early-init.el b/tools/emacs/early-init.el @@ -100,7 +100,8 @@ (defconst font-height 130 "Default font-height to use.") -(defconst font-family-mono "Ubuntu Mono" +;; 2024-10-05: Switching from Ubuntu Mono to Cascadia Mono +(defconst font-family-mono "Cascadia Mono" "Default monospace font-family to use.") (defconst font-family-sans "Ubuntu Sans" "Default sans font-family to use.") @@ -117,9 +118,12 @@ (when (member font-family-mono (font-family-list)) (set-face-attribute 'default nil :family font-family-mono - :height font-height) + :height font-height + :weight 'semi-light) (set-face-attribute 'fixed-pitch nil - :family font-family-mono)) + :family font-family-mono + :weight 'medium + :height 1.0)) (when (member font-family-sans (font-family-list)) (set-face-attribute 'variable-pitch nil :family font-family-sans diff --git a/tools/emacs/init.el b/tools/emacs/init.el @@ -157,6 +157,21 @@ (not *sys/full*) "Is it a light system ?") +;; If font-family-mono or font-family-sans are not available, use the default Emacs face +(when (member font-family-mono (font-family-list)) + (set-face-attribute 'default nil + :family font-family-mono + :height font-height + :weight 'semi-light) + (set-face-attribute 'fixed-pitch nil + :family font-family-mono + :weight 'medium + :height 1.0)) +(when (member font-family-sans (font-family-list)) + (set-face-attribute 'variable-pitch nil + :family font-family-sans + :weight 'regular)) + (vde/el-load-dir (concat user-emacs-directory "/config/")) (if (file-exists-p (downcase (concat user-emacs-directory "/hosts/" (vde/short-hostname) ".el")))