                                                 char-width
                                                 y))))
                                (.dispose offscreen-graphics-2d)
-                               glyph-image)))
+                               glyph-image))
           key-queue        (LinkedBlockingQueue.)
           on-key-fn        (or on-key-fn
                                (fn default-on-key-fn [k]

                                  line))
                   character-matrix))))

(def character->pos
  (reduce (fn [m [c x y]]
            (assoc m c [x y (+ x 12) (+ y 16)]))

          _                (info "Using font" (.getFontName normal-font))
          default-fg-color (Color. (long default-fg-color-r) (long default-fg-color-g) (long default-fg-color-b))
          default-bg-color (Color. (long default-bg-color-g) (long default-bg-color-g) (long default-bg-color-b))
          ;; create texture atlas
          _                (doseq [[c x y] character->pos]
                             (canvas/text character-canvas {:text (str c) :x x :y y}))
          character-map    (atom (vec (repeat rows (vec (repeat columns (make-terminal-character \space default-fg-color default-bg-color #{}))))))
          cursor-xy        (atom nil)
          ;; draws a character using webgl. 
          draw-character   (fn [ctx c [x y]]
                             (info "Drawing character" c)
                             #_(let [glyph-image                       (.createImage component char-width char-height)
                                   offscreen-graphics-2d ^Graphics2D (.getGraphics glyph-image)
                                   x                                 0
                                   y                                 (long (- char-height (.getDescent font-metrics)))
