diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-05-09 00:02:45 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-05-09 00:02:45 +0100 |
commit | d0605b049853320c94b1558f2e723f81978a1ad1 (patch) | |
tree | 337844dd005ed07fc043f320c18ae0e321d02e85 /Emacs/.config/emacs/config.org | |
parent | 5443f6f6379cafa8dd780bec75eab1884e50337d (diff) | |
download | dotfiles-d0605b049853320c94b1558f2e723f81978a1ad1.tar.gz dotfiles-d0605b049853320c94b1558f2e723f81978a1ad1.tar.bz2 dotfiles-d0605b049853320c94b1558f2e723f81978a1ad1.zip |
Reset-font-size on theme load rather than setting it in theme
Diffstat (limited to 'Emacs/.config/emacs/config.org')
-rw-r--r-- | Emacs/.config/emacs/config.org | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 4f36ac0..34b593b 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -248,6 +248,29 @@ never used before, 3 seems to be a reasonable default. ("ravenmaiden" 6) (_ 3)))) #+end_src +** Reset font size +Font size is best left unfixed: depending on the display size and the +machine, I will usually need to adjust it so it looks just right. +This function sets the font size using both those variables. It is +also added to `enable-theme-functions` such that loading a theme will +forcefully adjust the font size. + +#+begin_src emacs-lisp +(defun +oreo/font-reset (&optional theme) + (let ((font-size (thread-first + (pcase (system-name) + ("rhmaiden" 140) + (_ 120)) + (* + (pcase (display-pixel-width) + ((pred (>= 1920)) 0.90) + ((pred (>= 2560)) 1.24))) + floor))) + (set-face-attribute 'default nil :height font-size) + (set-face-attribute 'mode-line nil :height font-size))) + +(add-to-list 'enable-theme-functions #'+oreo/font-reset) +#+end_src * Essential packages External and internal packages absolutely necessary for the rest of this configuration. |