Empyreus / lanterna

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

Better font detection in SwingTerminal #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The SwingTerminal should prefer to use the "monospace" general font and then 
depending on the platform switch to a different one. Defaulting to "Courier 
New" is probably a bad thing.

Original issue reported on code.google.com by mab...@gmail.com on 15 Jul 2012 at 7:31

GoogleCodeExporter commented 9 years ago
According to http://docs.oracle.com/javase/1.5.0/docs/api/java/awt/Font.html, 
you could just use logical font name "Monospaced", and the jre is guaranteed to 
find a suitable font.

I just tested this in Linux. Using "Courier New" shows garbage wheras using 
"Monospaced" works properly, although I am not sure whihc font family it finds.

As long as the API offers the possibility to set some other font, always 
defaulting to "Monospaced" could be the right thing to do.

Original comment by janne.t....@gmail.com on 19 Jul 2012 at 1:48

GoogleCodeExporter commented 9 years ago
Yes, this should be the default font.

Original comment by mab...@gmail.com on 20 Jul 2012 at 12:00

GoogleCodeExporter commented 9 years ago
I had somehow told myself this was already fixed, but clearly it wasn't. Fixed 
it now to default to Monospaced on other platforms than Windows; if the Mac 
people here have some useful font overrides for Mac OS, please do let us know!

Pushed to 2.0.x-branch and default; Maven snapshots uploaded (2.0.2-SNAPSHOT 
and 2.1.0-SNAPSHOT)

Original comment by mab...@gmail.com on 31 Jul 2012 at 1:31