   (int (Math/pow 2 (inc (Math/floor (/ (Math/log v) (Math/log 2)))))))
 
 ;; A sequence of [character underline?]
-(def characters
-  (let [c (concat
-            "abcdefghijklmnopqrstuvwxyz"
-            "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-            " ~!@#$%^&*()_-+=[]{}|:;,./<>?'\""
-            "\u005C"
-            "\u00A7"
-            "\u00B7"
-            "\u01C1"
-            "\u039B"
-            "\u03B1"
-            "\u03C2"
-            "\u2206"
-            "\u2225"
-            "\u2240"
-            "\u2248"
-            "\u2500"
-            "\u2502"
-            "\u250C"
-            "\u2514"
-            "\u2518"
-            "\u2534"
-            "\u2584"
-            "\u2592"
-            "\u2648"
-            "\u2665"
-            "\u1D16"
-            "\u255a"
-            "\u2550"
-            "\u255d"
-            "\u2551"
-            "\u2554"
-            "\u2557"
-            "\u00B0"
-            "\u2191")
-       c (concat (map vector c (repeat false))
-                 (map vector c (repeat true)))]
-    c))
+(defn displayable-characters [font]
+  (let [chars (map char (filter (fn [c] (.canDisplay font (char c))) (range 0x0000 0xFFFF)))]
+    (concat (map vector chars (repeat false))
+            (map vector chars (repeat true)))))
 
 ;; A sequence of [[\character underline?] x y] where [x y] is the column,row in the character atlas.
-(def character-idxs
+(defn character-idxs
+  [characters]
   ;(let [character-matrix (partition-all (int (inc (Math/sqrt (count characters)))) characters)]
   (let [characters-per-line (int (inc (Math/sqrt (count characters))))
         character-matrix    (partition-all characters-per-line characters)]


(defn- init-buffers []
  (let [vertices              (float-array [1.0   1.0  0.0,
                                            0.0  1.0  0.0
                                            0.0, 0.0 0.0
                                            1.0   0.0 0.0])
        texture-coords        (float-array [1.0 1.0
                                            0.0 1.0

        (.setColor (Color. 0 0 0 0))
        (.fillRect 0 0 width height))
      ;; Loop through each character, drawing it
      (doseq [[[s underline?] col row]  (character-idxs characters)]
        (let [x ^int (* col char-width)
              y ^int (* (inc row) char-height)
              cx (+ 0 x)
