This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-03
Channels
- # adventofcode (6)
- # bangalore-clj (1)
- # beginners (15)
- # boot (4)
- # cider (14)
- # clara (1)
- # cljs-dev (1)
- # clojure (115)
- # clojure-art (1)
- # clojure-france (1)
- # clojure-greece (1)
- # clojure-korea (9)
- # clojure-russia (1)
- # clojure-spec (62)
- # clojure-taiwan (1)
- # clojure-uk (18)
- # clojurescript (5)
- # component (1)
- # cursive (3)
- # datascript (2)
- # datomic (17)
- # devcards (2)
- # editors (4)
- # emacs (65)
- # events (2)
- # funcool (4)
- # hoplon (92)
- # jobs (6)
- # london-clojurians (1)
- # luminus (1)
- # midje (2)
- # mount (1)
- # off-topic (1)
- # onyx (51)
- # protorepl (6)
- # re-frame (116)
- # reagent (7)
- # ring (2)
- # spacemacs (2)
- # specter (4)
- # untangled (1)
- # yada (1)
Doing some java interop here - a method requires the filepath of a font file
(defn font [property]
(BaseFont/createFont
(if (= (.toLowerCase ^String property) "helvetica")
(BaseFont/HELVETICA)
(.getPath (io/resource (str (.toLowerCase ^String property) ".ttf"))))
(BaseFont/WINANSI)
true))
which is fine when running with lein run
- however after preparing a .jar with lein uberjar
the path can't be resolved@mikepjb What library/class is that? Usually they should all take URL returned from io/resource
so just try omitting the .getPath
Looks like you can just pass in the path relative to the resource dir and it'll load it. Obviously untested
you're right @rauh
(defn font [property]
(BaseFont/createFont
(if (= (.toLowerCase ^String property) "helvetica")
(BaseFont/HELVETICA)
(str (.toLowerCase ^String property) ".ttf"))
(BaseFont/WINANSI)
true))
how do I read a field from a record? ex: (defrecord Data [id]) and then (:id data-item) doesn't work