Skip to content

Instantly share code, notes, and snippets.

@amalloy
Forked from anonymous/gist:1108130
Created July 26, 2011 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/1108145 to your computer and use it in GitHub Desktop.
Save amalloy/1108145 to your computer and use it in GitHub Desktop.
(def mono-font
(atom (Font. (if (is-mac)
"Monaco"
"Courier New")
Font/PLAIN default-font-size)))
(defn change-font [myfn]
(fn [myfont]
(let [new-font (swap! myfont
(fn [old-font]
(let [size (.getSize old-font)]
(.deriveFont font (myfn size)))))
doc @current-doc]
(doseq [area [:doc-text-area :repl-out-text-area :doc-in-text-area]]
(.setFont (doc area) new-font)))))
(def inc-font (change-font inc))
(def dec-font (change-font dec))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment