Ubuntu – Why do fonts look horrible in any java application

fontsjavaopenjdk

All fonts in java applications look horrible. I have seen a few questions about this previously, but they are quite old now (11.04 was the most recent, but that didn't seem to be the same problem). For some reason java applications do not use the system font (Ubuntu 11), but rather some elongated font that doesn't seem to have any anti-aliasing. So what I'm asking is if this is an open bug (couldn't find any on launchpad), something the developers have done wrong, or if there is a way to configure the fonts used in java application. Perhaps this is just a shortcoming of openjdk and I should install the Sun/Oracle version instead?

Following is an image of jitsi, but the problem is also present in minecraft, my internet-bank and anything else involving java. I'm on 12.04, but since I couldn't find anything on launchpad I'm assuming that isn't relevant.

picture of jitsi

Best Answer

I haven't test it but according to this forum post at inductiveautomation.com you can correct it by installing the fonts:

sudo apt-get install msttcorefonts

and changing lucidasans for arial in the properties of Java fonts:

sudo nano /usr/lib/jvm/java-6-sun/jre/lib/fontconfig.properties

There's also some useful links you can find at this StackOverflow question.