If you ever wanted to use some Swing based Java program like any IDE from JetBrains (IntelliJ Idea, Android Studio, PHPStorm…) or NetBeans and you were repulsed by how ugly the fonts looked, then I’ve got some good news for you. The solution is quite simple.
The problem is in Java itself and in its bad support of font rendering on the Linux platform. Luckily, there is a patched JDK that pretty much fixes that problem. It’s the standard OpenJDk with the FontFix patch applied. Simply add following repository and install OpenJDK from it (replace the original one).
You can read in the documentation that this software doesn’t support OpenJDK and requires the original Oracle JDK. I’ve been using Android Studio for a quite while with OpenJDK installed and I haven’t encounter any serious issues. I wouldn’t call it exactly smooth and flawless experience but it’s a Java program so what would you expect
Anyway, it’s often recommended for any JetBrains’ IDE to put following lines in the (idename).vmoptions file in order to get the best font rendering:
The file is located in the bin folder where the software is installed. You can experiment with the value of -Dawt.useSystemAAFontSettings. Try “on” or “gasp” instead.
The result with the standard unpatched OpenJDK was something in middle of the two provided. In both cases, the gui uses Segoe UI font and the text editor uses Source Code Pro.
That’s true unfortunately. I’m still running 13.1 and there are no longer available updates for the patched OpenJDK. So I just keep using the outdated version (I made a hard copy not the get it overwritten by an update) because the font antialiasing is way too important for me.
Btw. I’m not sure but when I last checked the author of that repo created another one with this patch. Might be worth checking.
I finally tried to install OpenJDK from the Tumbleweed repo (I wanted to do the full upgrade to 13.2 first, that’s why it took me so long) but I failed because of missing dependencies. I’m getting the message that nothing provides packages tzdata-java8 and libgif.so.7. I probably need another repo for this, but I don’t know which one. I tried to look those packages up using software.opensuse.org and I got some results for libgif but nothing for tzdata-java8. Any ideas?
Nevertheless, it might not matter. I used the repo to install patched versions of cairo, fontconfig and freetype and just that seemed to fix the problem with IntelliJ IDEA. I’m not sure if it is as good as it was before (antialiasing inside the editor could be better) but it’s perfectly usable even when running latest Java OpenJDK from standard repositories.
As I stated in the previous post, this is how it looks like when running standard Java OpenJDK but with patched cairo, fontconfig and freetype from the mentioned tumbleweed repo. In case you were interested, the UI font is Segoe UI and the editor font is Monaco.