Skip to content

Instantly share code, notes, and snippets.

@jtimberman
Forked from arnab/dynamic-fonts.el
Last active May 23, 2016 17:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtimberman/bac0515670004ba0eeee0af5db26c43c to your computer and use it in GitHub Desktop.
Save jtimberman/bac0515670004ba0eeee0af5db26c43c to your computer and use it in GitHub Desktop.
Dynamically adjust fonts in emacs based on screen resolution (Retina vs. Thunderbolt)
;; Gist-ed from in https://github.com/arnab/emacs-starter-kit
(defun fontify-frame (frame)
(interactive)
(if window-system
(progn
(if (> (x-display-pixel-width) 2000)
(set-frame-parameter frame 'font "Inconsolata 19") ;; Cinema Display
(set-frame-parameter frame 'font "Inconsolata 16")))))
;; Fontify current frame
(fontify-frame nil)
;; Fontify any future frames
(push 'fontify-frame after-make-frame-functions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment