all repos — nixfiles @ 173f06c9e467bd332754a73299c589b6fa17f664

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

Emacs: Use non-AA Monaco font on macOS
Alan Pearce alan@alanpearce.uk
Tue, 17 Jan 2017 11:39:17 +0100
commit

173f06c9e467bd332754a73299c589b6fa17f664

parent

4f655369e8e87b73e2a932091b5db84c81e7736a

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

jump to
M tag-emacs/emacs.d/init.orgtag-emacs/emacs.d/init.org
@@ -201,7 +201,9 @@ (interactive)     (variable-pitch-mode)
     (setq cursor-type 'bar))
 
-  (defun ap/set-fonts (mono-face mono-font-size variable-face variable-font-size)
+  (defun ap/set-fonts (mono-face mono-font-size variable-face variable-font-size antialias)
+    (if boundp 'ns-antialias-text
+      (setq ns-antialias-text antialias))
     (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)))
@@ -214,15 +216,15 @@ (defun ap/set-fonts-according-to-system ()     (interactive)
     (cond
      ((eq window-system 'w32)
-      (ap/set-fonts "Liberation Mono" 11 "Segoe UI" 11))
+      (ap/set-fonts "Liberation Mono" 11 "Segoe UI" 11 t))
      ((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 "SF Mono" 12 "Lucida Grande" 12)
-          (ap/set-fonts "ProggyClean" 11 "Lucida Grande" 12))))
+            (ap/set-fonts "SF Mono" 12 "Lucida Grande" 12 t)
+          (ap/set-fonts "Monaco" 10 "Lucida Grande" 12 nil))))
      ((eq window-system 'x)
       (set-fontset-font "fontset-default" 'unicode (font-spec :name "Terminus" :size 12))
-      (ap/set-fonts "Terminus" 12 "Lucida" 10))))
+      (ap/set-fonts "Terminus" 12 "Lucida" 10 nil))))
 
   (ap/set-fonts-according-to-system))
 #+END_SRC