           (mapcat identity
             (for [path (font-paths)]
               (try
-                (let [file        (File. (str path))
+                #_(log/info "type path" (type path))
+                (let [file        (.toFile path)
                       font-info   (make-font file)
                       font-name   (font-name font-info)
                       font-family (font-family font-info)]
                   [[font-name file]
                    [font-family file]])
                 (catch Exception e
-                  (log/error "Error loading" path e))))))))
+                  (log/error e "Error loading" path ))))))))
 
 (defn system-fonts []
   @system-fonts-map)
 
 (defn- as-font-path
   [x]
-  (try
-    (URL. x)
-    (catch MalformedURLException err
-      (let [file (File. x)]
-      (if (.exists file)
-        file
-        (get (system-fonts) x))))))
+  (if (= File (type x))
+    x
+    (try
+      (URL. x)
+      (catch MalformedURLException err
+          (let [file (File. x)]
+            (if (.exists file)
+              file
+              (get (system-fonts) x)))))))
   
-(defn- make-font
+(defn make-font
   [x]
   (if-let [font-path (as-font-path x)]
     ;; Load font from file

      scale
      0.0
      0.0
      (int codepoint))
    (zimg/draw-image chr-img img left-side-bearing (+ (int baseline) y))
    (zimg/write-png chr-img (str "char-image/" (int codepoint) ".png"))
    (zimg/write-png img (str "char-image/" (int codepoint) "-raw.png"))
    ;; convert to rgba
    (zimg/mode chr-img :rgba)))
  

    [(.get ix0) (.get iy0) (.get ix1) (.get iy1)]))


(defn- char-image [font-info char-width char-height ascent scale codepoint glyph-index]
  (let [;scale 0.015625
        [x0 y0 x1 y1]         (glyph-bitmap-box font-info scale glyph-index)
        baseline              (int (* ascent scale))
        [_ left-side-bearing] (map (partial * scale) (hmetrics font-info glyph-index))
        y                     (+ baseline y0)
        img                   (zimg/image char-width char-height 1)
        chr-img               (zimg/image char-width char-height 1)]
    ;(log/info "char-width" (char codepoint) "(" (int codepoint) ")" char-width char-height
    ;        "ascent" ascent "scale" scale "baseline" baseline
    ;        "left-side-bearing" left-side-bearing "y" y)
    ;(log/info "x0" x0 "y0" y0 "x1" x1 "y1" y1)
    ;; draw greyscale font
    (log-call "STBTruetype/stbtt_MakeGlyphBitmapSubpixel"
      font-info
      (get img :byte-buffer)
      char-width 
