   GlyphGraphics
   (glyph-graphics [this]
     ;; Adjust canvas to fit character atlas size
-    (let [^STBTTFontinfo font-info   (make-font name-or-path)
+    (let [ms (MemoryStack/create)
+          ^STBTTFontinfo font-info   (make-font name-or-path)
           scale                      (STBTruetype/stbtt_ScaleForPixelHeight
                                        font-info
                                        size)
           [advance
            left-side-bearing]        (map (partial * scale)
-                                       (hmetrics font-info
+                                       (hmetrics ms
+                                                 font-info
                                                  (STBTruetype/stbtt_FindGlyphIndex
                                                    font-info
                                                    (int \M))))

           (java.nio ByteBuffer)
           (java.nio.file Files Path)
           (org.lwjgl BufferUtils)
           (org.lwjgl.stb STBTruetype STBTTFontinfo)
           (org.apache.commons.io IOUtils)))

(set! *warn-on-reflection* true)
(set! *unchecked-math* true)

(def calls (atom []))
;(add-watch calls :persist
;  (fn [_ _ _ calls]
;    (spit "calls.log" calls)))
    

(defn log-call [method-name & args]
  (swap! calls (fn [calls] (conj calls {:method-name method-name :args args}))))

(defn- byte-buffer->str [^ByteBuffer buffer]

          char-height                size
          [ascent
           descent
           line-gap]                 (vmetrics ms font-info)
          _ (log/info "characters per line" (characters-per-line char-width (count characters)))
          cwidth     2048
          cheight    (zutil/next-pow-2 (* char-height (int (Math/ceil (/ (count characters)
