From 4732920bd3fb38db009639ad55f76cdea26d1735 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 18 Sep 2013 17:26:11 +0100 Subject: Add font configuration for OSX --- emacs/init.el | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'emacs') diff --git a/emacs/init.el b/emacs/init.el index c26f3e24..d9ce462e 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -123,23 +123,36 @@ Values: `desktop', `server', `laptop'") (variable-pitch-mode) (setq cursor-type 'bar)) - (if (eq window-system 'w32) - (let* ((font-size 10) - (mono-face (cond - ((member "Liberation Mono" (font-family-list)) - "Liberation Mono") - ((member "Liberation Sans Mono" (font-family-list)) - "Liberation Sans Mono") - ((member "Consolas" (font-family-list)) - "Consolas"))) - (variable-face "Segoe UI") - (default-font (concat mono-face "-" (number-to-string font-size)))) - (when mono-face - (set-face-font 'default default-font) - (set-face-font 'fixed-pitch default-font)) - (when variable-face - (set-face-font 'variable-pitch (concat variable-face "-" - (number-to-string (1+ font-size)))))))) + (cond + ((eq window-system 'w32) + (let* ((font-size 10) + (font-list (font-family-list)) + (mono-face (cond + ((member "Liberation Mono" font-list) + "Liberation Mono") + ((member "Liberation Sans Mono" font-list) + "Liberation Sans Mono") + ((member "Consolas" font-list) + "Consolas"))) + (variable-face "Segoe UI") + (default-font (concat mono-face "-" (number-to-string font-size)))) + (when mono-face + (set-face-font 'default default-font) + (set-face-font 'fixed-pitch default-font)) + (when variable-face + (set-face-font 'variable-pitch (concat variable-face "-" + (number-to-string (1+ font-size))))))) + ((eq window-system 'ns) + (let* ((font-size 14) + (font-list (font-family-list)) + (mono-face (cond + ((member "Droid Sans Mono" font-list) + "Droid Sans Mono"))) + (variable-face "Helvetica Neue") + (default-font (concat mono-face "-" (number-to-string font-size)))) + (when mono-face + (set-face-font 'default default-font) + (set-face-font 'fixed-pitch default-font)))))) (with-elapsed-timer "Setting up font styles" (let* ((font-height (face-attribute 'default :height)) -- cgit 1.4.1