summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
authorAlan Pearce2015-11-28 23:36:38 +0100
committerAlan Pearce2015-11-28 23:36:38 +0100
commitb8b160a427b785514c0e016155194bcc86976d62 (patch)
tree71b778df1f8035bfb3be55418c2a2c4523c541d9 /tag-emacs
parent7459e5ee09bc094fc47c0d03ec031fe2268825b9 (diff)
downloaddotfiles-b8b160a427b785514c0e016155194bcc86976d62.tar.lz
dotfiles-b8b160a427b785514c0e016155194bcc86976d62.tar.zst
dotfiles-b8b160a427b785514c0e016155194bcc86976d62.zip
Emacs: Specify variable font size in set-fonts
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.org46
1 files changed, 23 insertions, 23 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index c68dd8c..f107667 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -283,29 +283,29 @@ Highlighting quasi-quoted expressions in lisps is quite useful.
 When possible, set up fonts.  I don’t have any settings here for X11,
 because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresources/main][XResources file]].
 #+BEGIN_SRC emacs-lisp
-(when (or (display-graphic-p)
-          (daemonp))
-
-  (defun use-variable-fonts ()
-    (interactive)
-    (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)
-        (set-frame-font default-font t t)))
-    (when variable-face
-      (set-face-font 'variable-pitch (concat variable-face "-"
-                                             (number-to-string (1+ font-size))))))
-
-  (cond
-   ((eq window-system 'w32)
-    (ap/set-fonts "Consolas" "Segoe UI" 10))
-   ((eq system-type 'darwin)
-    (ap/set-fonts "Input Mono" "Input Sans Condensed" 13))))
+  (when (or (display-graphic-p)
+            (daemonp))
+
+    (defun use-variable-fonts ()
+      (interactive)
+      (variable-pitch-mode)
+      (setq cursor-type 'bar))
+
+    (defun ap/set-fonts (mono-face mono-font-size variable-face variable-font-size)
+      (when mono-face
+        (let ((default-font (concat mono-face "-" (number-to-string mono-font-size))))
+          (add-to-list 'default-frame-alist `(font . ,default-font))
+          (set-face-font 'fixed-pitch default-font)
+          (set-frame-font default-font t t)))
+      (when variable-face
+        (set-face-font 'variable-pitch (concat variable-face "-"
+                                               (number-to-string variable-font-size)))))
+
+    (cond
+     ((eq window-system 'w32)
+      (ap/set-fonts "Consolas" 10 "Segoe UI" 11))
+     ((eq system-type 'darwin)
+      (ap/set-fonts "Hack" 14 "Avenir" 14))))
 #+END_SRC
 
 Allow font-lock-mode to do background parsing.  I’m not really sure if