diff --git a/core/core-ui.el b/core/core-ui.el index 8da7801eb..bc6346368 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -2,18 +2,9 @@ ;;;; Load Theme ;;;;;;;;;;;;;;;;;;;;;;;; (when window-system - ;; No transparency! (set-frame-parameter nil 'alpha '(94 70)) - (let* ((font (nth 0 *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)))) - (setq ns-antialias-text font-aa) - (add-to-list 'default-frame-alist `(font . ,font-str)) - (add-to-list 'initial-frame-alist `(font . ,font-str))))) + ;; Load font + (cycle-font 0)) (add-to-list 'custom-theme-load-path my-themes-dir) (load-dark-theme) diff --git a/core/defuns-ui.el b/core/defuns-ui.el index f3bec4509..8423d94a4 100644 --- a/core/defuns-ui.el +++ b/core/defuns-ui.el @@ -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))) diff --git a/init.el b/init.el index 0a79a95ca..09752a0c4 100644 --- a/init.el +++ b/init.el @@ -31,6 +31,7 @@ (defconst *light-theme 'github) ; wtb better light theme... (defconst *fonts `(("Terminus (TTF)" ,(if (eq system-name "ganymede.local") 9 12) nil) + ("Ubuntu Mono" 16 t) ("Inconsolata" 22 t))) (add-to-list 'load-path my-core-dir)