Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to include fonts with my JavaFX application in the jar executable.

Java
font_stream = Javachessgui2.class.getResourceAsStream("resources/fonts/"+current_style.font);
        
        chess_font=Font.loadFont(font_stream, piece_size);


This code works for certain fonts, but not all TTF fonts. Some TTF fonts which if I install under Windows are working fine in a text editor, but when loaded in my JavaFX application, they break down. The text displayed is either empty or random dots and lines.
Posted
Updated 10-Jun-15 4:27am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900