You can get W2K/XP to anti-alias with Start ⇒ Control Panel ⇒ Display ⇒ Effects ⇒ Smooth edges of screenfonts. You can get Vista to anti-alias with Start ⇒ Control Panel ⇒ System and Maintenance ⇒ Performance Information and Tools ⇒ Adjust Visual Effects (on left) ⇒ smooth edges of screen fonts.
. You can get Vista to anti-alias with Start ⇒ Control Panel ⇒ System and Maintenance ⇒ Performance Information and Tools ⇒ Adjust Visual Effects (on left) ⇒ smooth edges of screen fonts.
With an LCD monitor, you want subpixel anti-aliasing called ClearType. To turn it on click Start ⇒ Control Panel ⇒ Appearance and Personalization ⇒ Personalization ⇒ Windows color and appearance ⇒ Open classic colour and appearance ⇒ Effects ⇒ ClearType.
Without anti-aliasing, you will see jagged diagonal lines especially in the large sizes of spidery fonts with thin diagonal lines (e.g. e.g. Bodoni, Book Antiqua, Garamond, Serif and Zapf Calligraphic) especially on the capital W. Sun, even when anti-aliasing, pays no attention to the font rendering hints. This why small font sizes are so grungy looking. Anti-aliasing is primarily to make large font sizes look better.
| Appearance | In JDK 1.6 |
| In JDK 1.2 | Anti-aliasing Gotchas |
| In JDK 1.3 | Links |
| In JDK 1.5 |
| Without anti-alias | Anti-aliased |
|---|---|
![]() |
![]() |
Several influences combine to decide whether you will get anti-aliasing:
It won’t do you any good to override the paint method of a peered Component such as Label, TextField or TextArea since the rendering is handled by the peer. Whether they are anti-aliased is determined by the OS Control Panel.
Smooth Metal LAF adds anti-aliasing to various Sun LAFs.
WrapLF is a LAF that lets you insert your own code.
// Making a JTextArea use anti-Alias fonts // only works in JDK 1.5+ jtextArea.putClientProperty( com.sun.java.swing.SwingUtilities2.AA_TEXT_PROPERTY_KEY, Boolean.TRUE );Since JDK 1.5, it is possible to set the system property globally with swing.aatext=true. You can do that with java.exe -Dswing.aatext=true on the command line. Unfortunately the results are not always desirable. Sometimes small fonts look worse anti-aliased.
I reported this to Sun and they explained the anomaly is a feature.
Internally when Swing sees a Thai or Arabic character, it switches to using a TextLayout for rendering. A TextLayout is created with a FontRenderContext, and the anti-aliasing Component of that FontRenderContext is applied when rendering too. In other words the usual anti-alias gambit does not work because it is anti-aliasing the wrong Component when you have Thai or Arabic characters.
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.62] | The information on this page is for non-military use only. | ||
| You are visitor number 19,689. | Military use includes use by defence contractors. | ||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) | ||
| http://mindprod.com/jgloss/antialiasing.html | J:\mindprod\jgloss\antialiasing.html | ||