summaryrefslogtreecommitdiff
path: root/.emacs.d/init-spw.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-11-29 12:57:20 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-11-29 12:57:20 -0700
commit554023cf4e1c7604b2a039d9abe5be7267f22b97 (patch)
tree7b77fc83cf59a788d66e2ff046975750ef33e10e /.emacs.d/init-spw.el
parent30e92ca4e8f8a79f9121459ec0f79af01911326a (diff)
downloaddotfiles-554023cf4e1c7604b2a039d9abe5be7267f22b97.tar.gz
second attempt to set Inconsolata weight to medium
Diffstat (limited to '.emacs.d/init-spw.el')
-rw-r--r--.emacs.d/init-spw.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el
index 8b176db9..ef9ec6ca 100644
--- a/.emacs.d/init-spw.el
+++ b/.emacs.d/init-spw.el
@@ -258,12 +258,14 @@ I use by default)."
;; choice of font and size is driven by aim to fit eighty columns of
;; text in both halves of my laptop's monitor
-(defvar spw/preferred-latin-fonts '("Inconsolata-13" "Cousine-10"))
+(defvar spw/preferred-latin-fonts
+ '(("Inconsolata-13" :weight medium) "Cousine-10"))
(defvar spw/preferred-han-fonts '("Noto Serif CJK JP-10"))
(defvar spw/preferred-hangul-fonts '("Noto Serif CJK KR-10"))
(defun spw/first-available-font (fonts)
(car (seq-drop-while
- (lambda (font) (not (find-font (font-spec :name font))))
+ (lambda (font)
+ (not (find-font (apply #'font-spec :name (ensure-list font)))))
fonts)))
(defun spw/select-cousine ()
(buffer-face-set
@@ -273,15 +275,16 @@ I use by default)."
;; harmless if function is not there to be removed
(remove-function after-focus-change-function #'spw/do-font-setup)
- (when-let ((latin-font
- (spw/first-available-font spw/preferred-latin-fonts)))
- (set-face-font 'default latin-font))
- (when-let ((han-font (spw/first-available-font spw/preferred-han-fonts)))
- (dolist (charset '(kana han symbol cjk-misc bopomofo))
- (set-fontset-font t charset han-font)))
- (when-let ((hangul-font
- (spw/first-available-font spw/preferred-hangul-fonts)))
- (set-fontset-font t 'hangul hangul-font))
+ (cl-flet ((fs (arg) (apply #'font-spec :name (ensure-list arg))))
+ (when-let ((latin-font
+ (spw/first-available-font spw/preferred-latin-fonts)))
+ (set-face-font 'default (fs latin-font)))
+ (when-let ((han-font (spw/first-available-font spw/preferred-han-fonts)))
+ (dolist (charset '(kana han symbol cjk-misc bopomofo))
+ (set-fontset-font t charset (fs han-font))))
+ (when-let ((hangul-font
+ (spw/first-available-font spw/preferred-hangul-fonts)))
+ (set-fontset-font t 'hangul (fs hangul-font))))
(when (and (not (spw/use-tabs-not-frames))
(find-font (font-spec :name "Cousine-10"))
(find-font (font-spec :name "Inconsolata-13" :weight 'medium)))