From: Peng Li Date: Mon, 8 May 2017 03:51:01 +0000 (+0800) Subject: emacs - add font check before setting X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=02c79e8c774c0bf691199eb8254d989c0fb1deb6;p=dotfiles.git emacs - add font check before setting --- diff --git a/emacs.d/config.org b/emacs.d/config.org index b89ed58..de6dfdb 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -1141,6 +1141,14 @@ extend org-mode's easy templates, refer to [[http://coldnew.github.io/coldnew-em *** variable-pitch-mode and fixed-pitch-mode [[https://yoo2080.wordpress.com/2013/05/30/monospace-font-in-tables-and-source-code-blocks-in-org-mode-proportional-font-in-other-parts/][monospace font in tables and source code blocks in org-mode, proportional font in other parts]] #+BEGIN_SRC emacs-lisp :tangle yes :results silent + ;; check if the fonts are available + (unless (find-font (font-spec :name "Ubuntu Mono")) + (warn "Font not found Ubuntu Mono")) + (unless (find-font (font-spec :name "Source Code Pro")) + (warn "Font not found Source Code Pro")) + (unless (find-font (font-spec :name "Source Sans Pro")) + (warn "Font not found Source Sans Pro")) + (set-face-attribute 'variable-pitch nil :font "Source Sans Pro" :height 160) (set-face-attribute 'fixed-pitch nil :font "Source Code Pro" :height (face-attribute 'default :height))