           (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

          height     cheight ;(max cwidth cheight)
          antialias  true
          char-idxs   (character-idxs char-width characters)]
      (STBTruetype/stbtt_GetFontVMetrics font-info ascent descent line-gap)
      (log/info "characters" (count characters) "cwidth" cwidth "cheight" cheight)
      (log/info "glyph image width" width "height" height)
      (log/info "char-idxs" char-idxs)
      ;(log/info "characters" (vec characters))
      ;(log/info "character-idxs" (vec (character-idxs characters)))
      (let [texture-image (zimg/image width height)
            ascent        (.get ascent)]
        ;; Loop through each character, drawing it
        (doseq [[c col row]  (reverse char-idxs)]
          (try
            (let [x  (* col char-width)
                  y  (* row char-height)
                  chr-img (char-image font-info char-width char-height ascent scale c)
                    #_#_[x0 y0 x1 y1] (codepoint-bitmap-box font-info scale (int c))
                    #_#_cy (int (+ y baseline y0))]
              (log/info "thread" (-> (Thread/currentThread) .getName))
              (log/info "drawing" c "@" x y)
              (zimg/draw-image texture-image
                             chr-img
                             x

                     :linux (linux-font-paths)
                     :macosx (macosx-font-paths)
                     :window (windows-font-paths))]
    (remove nil?
      (for [path font-paths
            ^File file (files path)
            :when (some (fn [extension] (.endsWith (.getAbsolutePath file)  extension))
                        extensions)]
        (let [^Path file-path (.toPath file)]
          (if (Files/isSymbolicLink file-path)
            (let [^Path link (Files/readSymbolicLink file-path)]
              (try 
                (Files/readSymbolicLink link)
                (catch IOException e
                  nil)))
            (.toPath file)))))))

(declare make-font)

