summary refs log tree commit diff stats
path: root/tag-emacs/emacs.d
diff options
context:
space:
mode:
Diffstat (limited to 'tag-emacs/emacs.d')
-rw-r--r--tag-emacs/emacs.d/init.el37
1 files changed, 11 insertions, 26 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index 7ee336d1..1eed32ee 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -86,35 +86,20 @@
     (variable-pitch-mode)
     (setq cursor-type 'bar))
 
+  (defun ap/set-fonts (mono-face variable-face font-size)
+    (when mono-face
+      (let ((default-font (concat mono-face "-" (number-to-string font-size))))
+        (add-to-list 'default-frame-alist `(font . ,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
-          (add-to-list 'default-frame-alist `(font . ,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)))))))
+    (ap/set-fonts "Consolas" "Segoe UI" 10))
    ((eq system-type 'darwin)
-    (let* ((font-size 14)
-           (mono-face "Droid Sans Mono")
-           (variable-face "Helvetica_Neue")
-           (default-font (concat mono-face "-" (number-to-string font-size))))
-        (when mono-face
-          (add-to-list 'default-frame-alist `(font . ,default-font)))
-        (when (and variable-face (display-graphic-p))
-          (set-face-font 'variable-pitch (concat variable-face "-"
-                                                 (number-to-string (1+ font-size)))))))))
+    (ap/set-fonts "Droid Sans Mono" "Helvetica_Neue" 14))))
 
 (let* ((font-height (face-attribute 'default :height))
        (small-font-height (max 1 (floor (* .917 font-height)))))