tags:

views:

46

answers:

1

I created an application which uses a custom font and it used to work for some reason. Now it doesn't recognize the font I included in the jar and it renders the text using the default font.

I really don't get it. When I run the application from Netbeans everything is OK.

Any ideas? I cleared the Java cache and everything but no luck. I am running JRE 1.6.0_20.

I even tried this guy's example and it does not work. It actually shows squares because of the font not found.

I hope someone has the solution.

A: 

JavaFX caches the fonts, so you must register the font before any use of the javafx.scene.text.Font class. Once you use the javafx Font classes, the system fonts are cached and it is never consulted again. Also, this is an AWT specific mechanism and will not work on platforms that support PRISM, like JavaFX-TV.

JimClarke