mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-10 15:33:36 -05:00
Fix cycle-font
This commit is contained in:
@@ -39,15 +39,22 @@
|
||||
(load-dark-theme)))
|
||||
|
||||
;;;###autoload
|
||||
(defun cycle-font ()
|
||||
(defun cycle-font (&optional i)
|
||||
"Cycle between fonts specified in *fonts in init.el"
|
||||
(interactive)
|
||||
(if (>= my/cycle-font-i (1- (length *fonts)))
|
||||
(setq my/cycle-font-i 0)
|
||||
(cl-incf my/cycle-font-i))
|
||||
(if (numberp i)
|
||||
(setq my/cycle-font-i i)
|
||||
(if (>= my/cycle-font-i (1- (length *fonts)))
|
||||
(setq my/cycle-font-i 0)
|
||||
(cl-incf my/cycle-font-i)))
|
||||
(let* ((font (nth my/cycle-font-i *fonts))
|
||||
(font-name (nth 0 font))
|
||||
(font-size (nth 1 font))
|
||||
(font-aa (nth 2 font)))
|
||||
(unless (member font-name (font-family-list))
|
||||
(error "Font %s isn't installed" font-name))
|
||||
(let ((font-str (concat font-name "-" (number-to-string font-size))))
|
||||
(add-to-list 'default-frame-alist `(font . ,font-str))
|
||||
(add-to-list 'initial-frame-alist `(font . ,font-str)))
|
||||
(load-font font-name font-size)
|
||||
(setq ns-antialias-text font-aa)))
|
||||
|
Reference in New Issue
Block a user