I'm trying to load a custom font in JavaFx css using this method
@font-face {
font-family: 'Roboto';
src: url('fonts/Roboto-Medium.ttf');
}
I've done every thing proper with the correct path but I'm getting this error
Nov 28, 2015 4:49:18 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
INFO: Could not load @font-face font [file:/C:/Users/RootUser/Desktop/Java8%20projects/RemoteViewer/out/production/JavaFxApplication/application/fonts/Roboto-Medium.ttf]
This is my project structure "screenshot"
Note I'm using intellij Idea as my IDE.Thanks in advance.
ttf
located? – Salisburysrc
package just as the fonts folder, I don't think the problem is with the path coz i have cross checked – Cruelty/fonts/Roboto-Medium.ttf
. You should edit your post with the location of each file involved though, it is very important is problem like these. – SalisburyCannot resolve file Roboto-Medium.ttf
– Crueltyout
directory? My wild guess would be that IntelliJ is ignoring resources and not copying them to the output directory. – Thildeout>production>JavaFxApplication>application>application.css
, By the way, this is also the first time I'm encountering this error and it seems unusual – Crueltyfont-family
. – Salisburyjava -version
). – Salisbury