diff --git a/core/core-osx.el b/core/core-osx.el index 9fd4c2b81..4fa98ef46 100644 --- a/core/core-osx.el +++ b/core/core-osx.el @@ -7,8 +7,6 @@ ;; Don't open files from the workspace in a new frame (setq ns-pop-up-frames nil) -(setq ns-antialias-text nil) - ;; fix emacs PATH on OSX (GUI only) (use-package exec-path-from-shell :if (memq window-system '(mac ns)) diff --git a/core/core-ui.el b/core/core-ui.el index 46bb72ed5..900a776d2 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -1,20 +1,20 @@ -;; User interface layout & behavior -(provide 'core-ui) +;;; core-ui.el -- User interface layout & behavior ;;;; Load Theme ;;;;;;;;;;;;;;;;;;;;;;;; (when window-system ;; No transparency! - (set-frame-parameter nil 'alpha 96) + (set-frame-parameter nil 'alpha '(94 70)) - (unless (member *default-font (font-family-list)) - (defconst *default-font *alt-font)) - - (unless (member *default-font (font-family-list)) - (error "Font %s isn't installed" *default-font)) - - (let ((font-str (concat *default-font "-" (number-to-string *default-font-size)))) - (add-to-list 'default-frame-alist `(font . ,font-str)) - (add-to-list 'initial-frame-alist `(font . ,font-str)))) + (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))))) (add-to-list 'custom-theme-load-path my-themes-dir) (load-dark-theme) @@ -53,8 +53,8 @@ (blink-cursor-mode 1)) ;; Show full path in window title -(setq frame-title-format - '(:eval (if (buffer-file-name) (abbreviate-file-name (buffer-file-name)) "%b"))) +;; (setq frame-title-format +;; '(:eval (if (buffer-file-name) (abbreviate-file-name (buffer-file-name)) "%b"))) ;;;; Modeline ;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -129,3 +129,7 @@ (setq mode-line-position -linepo) (sml/filter-mode-line-list 'mode-line-position)))) + + +(provide 'core-ui) +;;; core-ui.el ends here diff --git a/core/defuns-ui.el b/core/defuns-ui.el index 99cae2f6d..ec58093b3 100644 --- a/core/defuns-ui.el +++ b/core/defuns-ui.el @@ -1,7 +1,7 @@ (eval-when-compile (require 'cl)) (defvar my/dark-theme-p t) -(defvar my/presentation-mode-p nil) +(defvar my/cycle-font-i 0) ;;;###autoload (defun load-dark-theme() @@ -39,9 +39,14 @@ (load-dark-theme))) ;;;###autoload -(defun toggle-presentation-mode () +(defun cycle-font () (interactive) - (if my/presentation-mode-p - (load-font *default-font *default-font-size) - (load-font *presentation-font *presentation-font-size)) - (setq my/presentation-mode-p (not my/presentation-mode-p))) + (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))) + (load-font font-name font-size) + (setq ns-antialias-text font-aa))) diff --git a/init.el b/init.el index f25cfba89..0a79a95ca 100644 --- a/init.el +++ b/init.el @@ -30,12 +30,8 @@ (defconst *dark-theme 'brin) (defconst *light-theme 'github) ; wtb better light theme... -(defconst *default-font "Terminus (TTF)") -(defconst *default-font-size (if (eq system-name "ganymede.local") 9 12)) -(defconst *alt-font "Terminus") - -(defconst *presentation-font "Panic Sans") -(defconst *presentation-font-size 22) +(defconst *fonts `(("Terminus (TTF)" ,(if (eq system-name "ganymede.local") 9 12) nil) + ("Inconsolata" 22 t))) (add-to-list 'load-path my-core-dir) (add-to-list 'load-path my-modules-dir)