summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2013-09-18 17:26:11 +0100
committerAlan Pearce2013-09-18 17:26:44 +0100
commit4732920bd3fb38db009639ad55f76cdea26d1735 (patch)
tree878649421ac9cd6caef876bf9e081b96b22c4dd6 /emacs
parent1c7da5933ebaa92846b44df74e04c6ea77c8b6e3 (diff)
downloadnixfiles-4732920bd3fb38db009639ad55f76cdea26d1735.tar.lz
nixfiles-4732920bd3fb38db009639ad55f76cdea26d1735.tar.zst
nixfiles-4732920bd3fb38db009639ad55f76cdea26d1735.zip
Add font configuration for OSX
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el47
1 files changed, 30 insertions, 17 deletions
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))