rainb0w-light / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Visually corrupted characters on Linux #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please see attached screenshot. Characters are mangled as if only the left half 
of them is being drawn. Happens on both the regular terminal (konsole) and via 
Eclipse.

Could this be a font issue? Bad kerning? Is that being enforced via the 
library? I don't see any font-related methods. Any pointers?

Thanks in advance.

$ stty 
speed 38400 baud; line = 0;
-brkint ixoff -imaxbel

$ uname -a
Linux escher 2.6.39-gentoo-r3 #6 SMP PREEMPT Thu Dec 8 19:34:57 WET 2011 x86_64 
Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz GenuineIntel GNU/Linux

$ java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

Original issue reported on code.google.com by vasco.fi...@gmail.com on 4 May 2012 at 11:43

Attachments:

GoogleCodeExporter commented 9 years ago
That's interesting, I'm assuming it's the Swing terminal emulator window that's 
causing this? If you use TerminalFactory.Common to create your terminal, it 
should work fine in konsole, no?

For the SwingTerminal, this looks like a font issue. It's using
{{{
this.terminalFont = new Font("Courier New", Font.PLAIN, 14);
}}}
to set the font and there is no way to customize this at the moment. There 
should be. If this font isn't available on your system, then I wouldn't be 
surprised if the behaviour in your screenshot is what we get.

So, I think what we need is this:
 * Check if the font exists or not
 * Manually override which font and size to use
 * Automatically find a proper mono-spaced font if the selected one is invalid

Original comment by mab...@gmail.com on 5 May 2012 at 2:29

GoogleCodeExporter commented 9 years ago
Indeed if we use the common terminal it works. That is our approach now.
Your strategy seems adequate.

Thanks for your support.

Original comment by vasco.fi...@gmail.com on 5 May 2012 at 4:21

GoogleCodeExporter commented 9 years ago
Wow, I should have come back to this a long time ago, sorry!
In the latest 2.0 snapshot I have added Font selection to the SwingTerminal 
constructor, so you can pick your own font (preferably monospaced). I can 
backport this to 1.0.x series too.

Still though, some intelligence in picking a default font could be done. I'll 
see what I can come up with!

Original comment by mab...@gmail.com on 7 Jul 2012 at 9:05

GoogleCodeExporter commented 9 years ago
I've now backported and released 1.0.6 to Maven central, you can specify the 
font to use in the SwingTerminal constructor - or set the 
`org.lanterna.terminal.SwingTerminal.defaultFont` property to whatever font you 
want to use.

Original comment by mab...@gmail.com on 7 Jul 2012 at 9:23