Lanterna how do I change the font size?

324 Views Asked by At

I've been trying for 3 days now to change the font size in Laterna because it's so small in the console that it's unreadable. In the API I can only get:

SwingTerminalFontConfiguration.newinstance(....);

So I tried to use (new Font) but it didn't change. I need help, if you can help me please send me an example script to explain it.

1

There are 1 best solutions below

1
PAGMA Online On
Font myFont = new Font("Monospaced", Font.PLAIN, 20); // Change the number 20 to your desired font size
            AWTTerminalFontConfiguration myFontConfiguration = AWTTerminalFontConfiguration.newInstance(myFont);
            // Use myFontConfiguration when creating your terminal
            // Create a default terminal (will use Swing on desktop)
            // Use myFontConfiguration when creating your terminal
            DefaultTerminalFactory dtf = new DefaultTerminalFactory();
            dtf.setForceAWTOverSwing(true);
            dtf.setTerminalEmulatorFontConfiguration(myFontConfiguration);
            Terminal terminal = dtf.createTerminal();