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 (Liquid Crystal Display) 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. 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 Java 1.6 |
| In Java 1.2 | Anti-aliasing Gotchas |
| In Java 1.3 | Links |
| In Java 1.4 |
| Without anti-alias | Anti-aliased |
|---|---|
![]() |
![]() |
Several influences combine to decide whether you will get anti-aliasing:
To anti-alias fonts in AWT (Advanced Windowing Toolkit), you have to go through a gambit like this in your Canvas
There is another technique that uses an undocumented Sun class.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 (Operating System) Control Panel.
Smooth Metal LAF (Look And Feel) adds anti-aliasing to various Sun LAFs.
WrapLF is a LAF that lets you insert your own code.
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.
|
|
You can get the freshest 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 | |
![]() | Please email your feedback for publication,
letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording,
broken/redirected link reports, suggestions to improve this page or comments to
Roedy Green :
| |
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.179.212] | |
| Feedback | You are visitor number 45,111. | |