Commit 0661b9bfdf7b

Vincent Demeester <vincent@sbr.pm>
2024-05-13 10:23:43
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>
1 parent 7e25be8
Changed files (3)
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
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
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")))