Font looking different on linux and on windows

57 views
Skip to first unread message

Paweł Kubas

unread,
Jul 15, 2024, 3:27:41 PM7/15/24
to lanterna-discuss
I include truetype font in resources and import it to the application like that:
// Set font
InputStream inputStream = Application.class.getClassLoader()
.getResourceAsStream("font/C64_Pro_Mono-STYLE.ttf");
Font font = null;
try {
Font fontTmp = Font.createFont(Font.TRUETYPE_FONT, inputStream);
font = fontTmp.deriveFont(fontSize);
} catch (IOException | FontFormatException e) {
e.printStackTrace();
return;
}
inputStream.close();

and later on:
// Config terminal
DefaultTerminalFactory terminalFactory = new DefaultTerminalFactory();
terminalFactory.setTerminalEmulatorFontConfiguration(
SwingTerminalFontConfiguration.newInstance(font));

The application is being develped on linux and everything works great (screenshot below).
Screenshot from 2024-07-15 21-17-23.png

But when i run the jar (or compile it from zero) on windows the font is completely broken:
Screenshot from 2024-07-15 21-21-59.png

For the fully colored tile i use Û character (Unicode Value U+00db).
The font used by me is C64 Pro Mono STYLE from https://style64.org/c64-truetype.

Thanks for help.
Reply all
Reply to author
Forward
0 new messages