Swing Font Rendering Still Playing Catch-up
Three years ago I chose SWT for my accounting application partly because Swing was painfully bad at rendering text. Since then Swing has come a long way, though it’s still not as good as Microsoft or Apple.
See for yourself; below are examples of different fonts rendered on different platforms.
Times New Roman:

Swing clearly has room to improve. But maybe a change of font will do it good. Let’s try Courier New:

This beauty contest is more evenly balanced. Swing is still too jagged, but Gnome’s by-line is too light and Apple’s header is bleeding into the ‘paper’.
Now let’s try Verdana:

Oh dear, Gnome really fell over. And is it just me, or does Java Swing have a greenish hue? Not healthy.
So it looks like Microsoft’s ClearType is the winner, followed closely by Apple, with Gnome and Swing bringing up the rear.
Notes:
- More discussion of Microsoft vs Apple font rendering is here and here.
- The html to reproduce the tests is here. For JEditorPane, change ‘px’ to ‘pt’. The exact configuration was:
Gnome: Firefox on Ubuntu 7.04 with font rendering set to ‘Subpixel Smoothing’
Swing: JEditorPane on Java 1.6.0_01 (with VM property awt.useSystemAAFontSettings=lcd)
Windows: Firefox on Windows XP SP2 with ClearType
Apple: Safari browser on Windows XP SP2
November 13th, 2008 at 2:20 am (GMT)
bhhtrygo563d2oom
January 15th, 2009 at 6:17 am (GMT)
I think current state of font rendering is the best of all:
http://img-fotki.yandex.ru/get/3002/fork-posix.0/0_1dba5_712467ad_orig
January 15th, 2009 at 6:18 am (GMT)
Damn, current state in Ubuntu 8.10, autohinter, slight hinting