summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2024-07-27 10:37:21 +0100
committerGrégoire Duchêne <gduchene@awhk.org>2024-07-27 10:37:21 +0100
commit373d9c521922fd2dabae5f2b0684f78c6321e36a (patch)
treecd24e229ebf1e0f0785cc61a273b870de8edc46f
parent4bd01a5bae0cdec21cb4df4d5505de391a6ba869 (diff)
emacs: Use nice fonts
-rw-r--r--emacs/functions.el7
-rw-r--r--emacs/init.el9
2 files changed, 16 insertions, 0 deletions
diff --git a/emacs/functions.el b/emacs/functions.el
index accb52b..9eb405b 100644
--- a/emacs/functions.el
+++ b/emacs/functions.el
@@ -43,6 +43,13 @@ enabled."
(enable-theme light-theme)
(disable-theme dark-theme)))))
+(defun my/set-frame-font ()
+ "Set font in the selected frame."
+ (let* ((pred (lambda (font) (x-family-fonts (plist-get font :family))))
+ (font (seq-find pred my/fonts)))
+ (when font
+ (apply #'set-face-attribute `(default nil ,@font)))))
+
;; “Window Management” Functions
diff --git a/emacs/init.el b/emacs/init.el
index e246e6d..637e775 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -107,6 +107,15 @@
(defvar my/night-theme nil "Theme to use during the night.")
+(defvar my/fonts
+ '((:family "Iosevka Fixed Slab" :height 140)
+ (:family "Iosevka SS04" :height 140)
+ (:family "Iosevka" :height 140)
+ (:family "Menlo" :height 120))
+ "Fonts to try as default.")
+
+(add-hook 'after-init-hook #'my/set-frame-font)
+
;; “Window” Management