all repos — nixfiles @ 7d5c681af4ac7a571e2bd8ff45b020562b5b3611

System and user configuration, managed by nix and home-manager

Emacs: Include line-spacing in font definition
Alan Pearce alan@alanpearce.uk
Fri, 28 Apr 2017 17:05:03 +0200
commit

7d5c681af4ac7a571e2bd8ff45b020562b5b3611

parent

e2f1b8d344cd2a851663bd90db26bb1036424957

1 files changed, 5 insertions(+), 3 deletions(-)

jump to
M emacs/.emacs.d/init.orgemacs/.emacs.d/init.org
@@ -239,9 +239,11 @@ (interactive)     (variable-pitch-mode)
     (setq cursor-type 'bar))
 
-  (defun ap/set-fonts (mono-face mono-font-size variable-face variable-font-size antialias)
+  (defun ap/set-fonts (mono-face mono-font-size variable-face variable-font-size antialias &optional new-line-spacing)
     (if (boundp 'ns-antialias-text)
-      (setq ns-antialias-text antialias))
+        (setq ns-antialias-text antialias))
+    (if (boundp 'new-line-spacing)
+      (setq line-spacing new-line-spacing))
     (when mono-face
       (let ((default-font (font-spec :family mono-face :size  mono-font-size)))
         (add-to-list 'default-frame-alist `(font . ,(format "%s %s" mono-face mono-font-size)))
@@ -259,7 +261,7 @@ ((eq window-system 'ns)       (let ((displays (string-to-number (shell-command-to-string "system_profiler SPDisplaysDataType | grep \"Online: Yes\" | wc -l"))))
         (if (eq displays 1)
             (ap/set-fonts "Lekton" 20 "Lucida Grande" 16 t)
-          (ap/set-fonts "Monaco" 10 "Lucida Grande" 12 nil))))
+          (ap/set-fonts "Monaco" 10 "Lucida Grande" 12 nil 0.1))))
      ((eq window-system 'x)
       (set-fontset-font "fontset-default" 'unicode (font-spec :name "Terminus" :size 14))
       (ap/set-fonts "Fixed" 14 "Lucida" 14 nil))))