JavaFx font not showing on Windows/OracleJDK

Viewed 315

I have a JavaFx application that uses Material Icons ttf font for icons. On Windows, with Oracle JDK, the font seems to be loaded correctly, as System.out.println(font); returns:

Font[name=Material Icons, family=Material Icons, style=Regular, size=10.0]

It is in the list of available fonts:

for (String fontFamily : Font.getFamilies()) {
    System.out.println(fontFamily);
}

returns:

...
Material Icons
...

However, no matter whether i set the font in the code (e.g. label.setFont(font)), or I specify the family as a css property (e.g. label.setStyle("-fx-font-family: \"Material Icons\";");), the font is not shown correctly in the application.

On the other hand, everything works perfectly on OpenJDK on Arch Linux. If you have any idea on how to solve or further debug the problem, thank you very much!

0 Answers
Related