From 373d9c521922fd2dabae5f2b0684f78c6321e36a Mon Sep 17 00:00:00 2001 From: Grégoire Duchêne Date: Sat, 27 Jul 2024 10:37:21 +0100 Subject: emacs: Use nice fonts --- emacs/functions.el | 7 +++++++ emacs/init.el | 9 +++++++++ 2 files changed, 16 insertions(+) (limited to 'emacs') 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 -- cgit v1.2.3-70-g09d2