Use mixed-pitch for getting variable-pitch fonts where it's nice

This commit is contained in:
larstvei 2023-06-23 15:52:30 +02:00
parent 3a712cf8be
commit 850537f0a1

View File

@ -541,18 +541,29 @@
** Font ** Font
Pick the first of the following fonts that is installed on the system. I primarily use [[https://github.com/adobe-fonts][Adobe Fonts]].
My default monospace font is [[https://github.com/adobe-fonts/source-code-pro][Source Code Pro]]:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(cond ((member "Source Code Pro" (font-family-list)) (when (member "Source Code Pro" (font-family-list))
(set-face-attribute 'default nil :font "Source Code Pro-15")) (set-face-attribute 'default nil :font "Source Code Pro-15"))
((member "Roboto Mono" (font-family-list))
(set-face-attribute 'default nil :font "Roboto Mono-14")) #+end_src
((member "Fira Code" (font-family-list))
(set-face-attribute 'default nil :font "Fira Code-15")) My preferred proportional font is [[https://github.com/adobe-fonts/source-serif][Source Serif]]. In order to get
((member "Inconsolata" (font-family-list)) variable-pitch fonts where it makes sense, I use [[https://gitlab.com/jabranham/mixed-pitch][mixed-pitch]].
(set-face-attribute 'default nil :font "Inconsolata-14")))
#+begin_src emacs-lisp
;; Use a variable pitch, keeping fixed pitch where it's sensible
(use-package mixed-pitch
:defer t
:hook (text-mode . mixed-pitch-mode)
:config
(when (member "Source Serif Pro" (font-family-list))
(set-face-attribute 'variable-pitch nil :family "Source Serif Pro")))
#+end_src #+end_src