From 0d523b18197cca8f680f1b2e397799705f4639f9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 1 Oct 2015 03:41:16 -0400 Subject: [PATCH] Switch between default and big font --- core/core-vars.el | 3 +++ core/lib/defuns-ui.el | 19 ++++++++++++++++--- init.el | 4 +++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/core/core-vars.el b/core/core-vars.el index bb4cd256b..53c657442 100644 --- a/core/core-vars.el +++ b/core/core-vars.el @@ -45,5 +45,8 @@ gets killed.") "A list of files that count as 'project files', which determine whether a folder is the root of a project or not.") +(defcustom narf-big-font (font-spec :family "Ubuntu Mono" :size 18 :antialias t) + "Font to switch to in big mode") + (provide 'core-vars) ;;; core-vars.el ends here diff --git a/core/lib/defuns-ui.el b/core/lib/defuns-ui.el index cd02e01be..9a6e20601 100644 --- a/core/lib/defuns-ui.el +++ b/core/lib/defuns-ui.el @@ -20,10 +20,23 @@ ;;;###autoload (defun narf:toggle-big-mode () (interactive) - (if narf--big-mode - (set-frame-font (apply #'font-spec narf-default-font)) - (set-frame-font (apply #'font-spec narf-big-font))) + (if narf--big-mode narf/default-font (narf/big-font)) (setq narf--big-mode (not narf--big-mode))) +;;;###autoload +(defun narf/reset-theme () + (interactive) + (load-theme 'narf-dark t t)) + +;;;###autoload +(defun narf/default-font () + (interactive) + (set-frame-font narf-default-font)) + +;;;###autoload +(defun narf/big-font () + (interactive) + (set-frame-font narf-big-font)) + (provide 'defuns-ui) ;;; defuns-ui.el ends here diff --git a/init.el b/init.el index 6cf6d2c3a..a02446023 100644 --- a/init.el +++ b/init.el @@ -48,7 +48,9 @@ (tool-bar-mode -1) ; no toolbar (menu-bar-mode -1) ; no menubar - (set-frame-font (font-spec :family "terminus (ttf)" :size 12 :antialias nil)) + (defconst narf-default-font (font-spec :family "terminus (ttf)" :size 12 :antialias nil)) + (defconst narf-big-font (font-spec :family "Ubuntu Mono" :size 18 :antialias t)) + (load (concat user-emacs-directory "init-load-path.el")) (load-theme (if window-system 'narf-dark 'brin) t) (set-frame-parameter nil 'fullscreen 'fullboth)