pashapm / lanterna

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

Output in various Terminals #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I apologize up front for not having a lot of experience with developing an 
application for terminals.

So here it goes. I've written a game in Lanterna that utilizes numerous Unicode 
characters. I don't believe I'm using anything that fancy. Everything looks 
great on my Mac. I assume that since I used TerminalFacade, it opens my 
application in a Swing terminal? When my teammates open the application and 
srun it on their Windows machine many of the Unicode characters are not 
rendering correctly and the output in their terminals looks much smaller than 
on my computer (I'm assuming this is just a resolution issue). 

Here are my questions?

* Why are they not seeing what I'm seeing?
* Outside of changing the resolution of our screens is there any way to view 
the output larger?
* It is all frustrating seeing how Unicode characters look in a web browser, 
then you try them out in a Terminal and many of them are all scaled or 
smooshed. What causes this? I assume the stretching is due to the fact that 
some characters are not monospaced. But what about scaling?

Thank you for the great project!

Original issue reported on code.google.com by raymondv...@gmail.com on 10 Apr 2015 at 1:59

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Okay, so, DefaultTerminalFactory will create the Swing implementation by 
default if you run it on a system with a graphical user interface available, so 
that's probably what all of you are seeing (it's a good idea to verify it 
really is a Swing terminal by looking at the icon of the window; 'real' 
terminal emulators usually have a proper icon while the Swing terminal 
implementation in Lanterna should be a default or a java icon).

Now, the problem you're seeing is most likely related to fonts. SwingTerminal 
will load up with a list of default fonts, but if you create the SwingTerminal 
yourself, you can supply an additional list of fonts you want it to consider. 
It will have a list in order of priority, so whenever a character is written, 
it will check if the first character in the font supports it, it not take the 
next one and so on.

The problem with this is size; most fonts have variable-width characters and 
this is not good for text terminals which normally is designed to work with 
monospaced fonts. Because of this, Lanterna will reject any fonts given that 
are not monospaced.

So, I think you should check the unicode characters you are using, is there any 
monospaced font available on the windows machines that actually has these 
characters you are trying to use? In that case, you might want to add some code 
to check if that font is available, and if so, add it to the list of fonts to 
be used by the SwingTerminal. Notice that things like text size and color can 
also be customized in the same way.

Original comment by mab...@gmail.com on 28 Jun 2015 at 12:03