JavaFx Could not load @font-face font because of com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
I found the possible cause and a work-around:
Under the hood the css-loader uses the function Font.loadFont
to load the font-face in your CSS.
Font.loadFont
simply returns null
if it fails, which give the "warning".
It seems that this function does not work with %20
it its path/url-string.
So you need to resolve the path and then replace it with a space.
That means you will have to load your fonts with code in stead of with CSS (for now).
In Clojure my work-around looks like this:
(require '[clojure.java.io :as cio])
(require '[clojure.string :as s])
(-> "fonts/SourceCodePro-Regular.ttf"
cio/resource
str
(s/replace "%20" " ")
(javafx.scene.text.Font/loadFont 10.))
;-)