Skip to content

Instantly share code, notes, and snippets.

Created July 26, 2011 21:39
Show Gist options
  • Save anonymous/1108130 to your computer and use it in GitHub Desktop.
Save anonymous/1108130 to your computer and use it in GitHub Desktop.
(def mono-font
(if (is-mac)
(agent (Font. "Monaco" Font/PLAIN default-font-size))
(agent (Font. "Courier New" Font/PLAIN default-font-size))))
(defn change-font [myfn]
(fn [myfont]
(let [new-font (Font. "Monaco" Font/PLAIN (myfn (.getSize @mono-font)))]
(send-off myfont
(fn [old-font] new-font))
(do
(.setFont (@current-doc :doc-text-area) new-font)
(.setFont (@current-doc :repl-out-text-area) new-font)
(.setFont (@current-doc :doc-in-text-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