How to fix font rendering in Swing in Java based application in Linux (Fedora/KDE)?
Hi!
Font rendering in PyCharm on my Fedora 21 with KDE is very bad. I use (default?) DejaVu Sans Mono but all others available in the dropdown in settings (DialogInput, FreeMono, Liberation Mono, Monospaced, Nimbus Mono L, Source Code Pro) do not look any better.
I've been googling for an answer how to fix font rendering in Java applications using Swing for GUI (which PyCharm does) but could not find anything that helps. For example putting '-Dawt.useSystemAAFontSettings=lcd' in 'pycharm64.vmoptions' didn't help.
From what I've read Swing as opposed to SWT (which Eclipse uses) renders fonts itself and does not use system's native font rendering. Font rendering is a rather complicated matter (http://www.infinality.net/forum/viewtopic.php?f=2&t=80#p395) and I didn't manage to find my way through this. The additional trouble is that there's Oracle JDK and OpenJDK and each has its own quirks. I (naturally:)) prefer OpenJDK and that's what I use.
I have to note that after I installed Fedora/KDE, font rendering was ugly but after setting Xft.lcdfilter to 'lcddefault' in ~/.Xresources (see http://blog.andreas-haerter.com/2011/07/18/tune-improve-fedora-fonts-typeface-ubuntu-like-sharp-fonts) it's much better. However as Swing does not use system's native font rendering as said above this should not matter.
Considering how much bad font rendering puts user off I guess there must be some guide how to fix this in JetBrains' products. Is there any?
Regards,
Piotr Dobrogost
Font rendering in PyCharm on my Fedora 21 with KDE is very bad. I use (default?) DejaVu Sans Mono but all others available in the dropdown in settings (DialogInput, FreeMono, Liberation Mono, Monospaced, Nimbus Mono L, Source Code Pro) do not look any better.
I've been googling for an answer how to fix font rendering in Java applications using Swing for GUI (which PyCharm does) but could not find anything that helps. For example putting '-Dawt.useSystemAAFontSettings=lcd' in 'pycharm64.vmoptions' didn't help.
From what I've read Swing as opposed to SWT (which Eclipse uses) renders fonts itself and does not use system's native font rendering. Font rendering is a rather complicated matter (http://www.infinality.net/forum/viewtopic.php?f=2&t=80#p395) and I didn't manage to find my way through this. The additional trouble is that there's Oracle JDK and OpenJDK and each has its own quirks. I (naturally:)) prefer OpenJDK and that's what I use.
I have to note that after I installed Fedora/KDE, font rendering was ugly but after setting Xft.lcdfilter to 'lcddefault' in ~/.Xresources (see http://blog.andreas-haerter.com/2011/07/18/tune-improve-fedora-fonts-typeface-ubuntu-like-sharp-fonts) it's much better. However as Swing does not use system's native font rendering as said above this should not matter.
Considering how much bad font rendering puts user off I guess there must be some guide how to fix this in JetBrains' products. Is there any?
Regards,
Piotr Dobrogost
Please sign in to leave a comment.
So what could be the solution?
(Ubuntu 14.10 with GNome)
https://wiki.archlinux.org/index.php/Java_Runtime_Environment_Fonts
I'm using ArchLinux, so installing jdk7-openjdk-infinality from AUR (https://aur.archlinux.org/packages/jdk7-openjdk-infinality/) fixed font rendering for me.
Also i used to use tuxjdk (https://code.google.com/p/tuxjdk/), but jdk7-openjdk-infinality from AUR works better for me.
Arch's PKGBUILD is very simple, so i hope you can build patched version of jdk in Ferora easily.
The same problem is with Netbeans so there are many users affected thus I would be surprised if there weren't any "simple/ready" solution available for main Linux distros (like Fedora :))...
For those interested some more links:
INSTALL OPENJDK PATCHED WITH FONT FIXES [UBUNTU PPA] (http://www.webupd8.org/2013/06/install-openjdk-patched-with-font-fixes.html)
Infinality and OpenJDK - Patch (http://www.infinality.net/forum/viewtopic.php?f=2&t=275)