Changing Text Font Size

206 views
Skip to first unread message

theabst...@gmail.com

unread,
Jun 14, 2017, 1:23:09 AM6/14/17
to lanterna-discuss
I was wondering how you would go about changing the text font size.














That is what it currently looks like, and I do wish to make it smaller.

Any help?

Martin Berglund

unread,
Jul 9, 2017, 8:55:07 AM7/9/17
to lanterna...@googlegroups.com
Hello Abstract Kiwi,
I'm guessing you are using the SwingTerminalFrame above? You can set the font size by using a custom SwingTerminalFontConfiguration to SwingTerminalFrame; if you're using DefaultTerminalFactory, there's similarly a method setTerminalEmulatorFontConfiguration you can use for this.

Thanks,
Martin

--
Det här meddelandet skickas till dig eftersom du prenumererar på gruppen "lanterna-discuss" i Google Grupper.
Om du vill sluta prenumerera på den här gruppen och inte längre få någon e-post från den skickar du ett e-postmeddelande till lanterna-discuss+unsubscribe@googlegroups.com.
Fler alternativ finns på https://groups.google.com/d/optout.

Leather Dog Muksihs

unread,
Sep 18, 2020, 5:01:19 PM9/18/20
to lanterna-discuss
It is not at all clear how to increase the font size on the automatic GUI terminal.

It displays so small I can't read it. I'm farsighted.

The code reads like it is hard-coded for a size of 14.

On Sunday, July 9, 2017 at 8:55:07 AM UTC-4 Martin wrote:
Hello Abstract Kiwi,
I'm guessing you are using the SwingTerminalFrame above? You can set the font size by using a custom SwingTerminalFontConfiguration to SwingTerminalFrame; if you're using DefaultTerminalFactory, there's similarly a method setTerminalEmulatorFontConfiguration you can use for this.

Thanks,
Martin

Den 14 juni 2017 14:23 skrev <theabst...@gmail.com>:
I was wondering how you would go about changing the text font size.














That is what it currently looks like, and I do wish to make it smaller.

Any help?

--
Det här meddelandet skickas till dig eftersom du prenumererar på gruppen "lanterna-discuss" i Google Grupper.
Om du vill sluta prenumerera på den här gruppen och inte längre få någon e-post från den skickar du ett e-postmeddelande till lanterna-discu...@googlegroups.com.

Martin Berglund

unread,
Oct 4, 2020, 1:43:46 AM10/4/20
to lanterna...@googlegroups.com
Yes, you are right! Not sure how we could have missed this for all these years. I will amend the code to allow you to set the size manually.

Regards,
Martin

Martin Berglund

unread,
Oct 4, 2020, 2:29:44 AM10/4/20
to lanterna...@googlegroups.com
Ok, so, I wasn't entirely correct. You can still create a custom SwingTerminalFontConfiguration with different sized fonts using the newInstance method that takes a list of fonts. That way you get complete control over which fonts will be used (although non-monospaced fonts will be filtered out). However, I'm adding a new static getDefaultOfSize method that will use the hard-coded list of preferred fonts per platform, but with a supplied font size.

Regards,
Martin
Reply all
Reply to author
Forward
0 new messages