Subpixel Antialiasing Fontrendering in Editor



I've played with the new subpixel antialiasing in editor. It was introduced with build 39 of JDK 6. There's not an option to activate it NetBeans yet. Somebody asked how to hack the NetBeans sources to try it, so for editor you have to do is to change this file and put a new hint into the Map, replacing the old hint:

    private static final Map textAntialiasingHintsMap = new HashMap();
    static {
        textAntialiasingHintsMap.put(RenderingHints.KEY_TEXT_ANTIALIASING,
            RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
    }

The VALUE_TEXT_ANTIALIAS_LCD_HRGB hint activates subpixel rendering. Then you need to recompile editor module with the very latest build of JDK (39). Once recompiled, replace the original editor module in ide5/modules.

You will probably ask when will we add this option to NetBeans - it will take some time, because we want also to detect OS settings of antialiasing to make the configuration easy (both under Windows and Linux which is not trivial). I'll blog about it when the option is there.

It's important to note that the best quality is achieved with a DVI connector - if your LCD is connected with an analog connector, the rendering may look slightly worse than with DVI. Here are the screenshots, the last one is with Subpixel Antialiasing activated in editor:


No AA in editor
No AA in menus


Normal AA in editor
Normal AA in menus

Subpixel rendering in editor
Normal AA in menus


You can also take a look at relevant thread at Javalobby.

Update: You can try to the subpixel AA in NetBeans yourself by downloading the daily build 200506072010 and replacing editor in ide5/modules by this jar (it's a good idea to keep a backup of the original file). Delete your userdir before launching the IDE. The AA setting in Editor (Tools | Options | Editing | Editor Settings | Text Antialiasing) activates the subpixel one instead of the regular. You need to use the latest JDK build to see it, otherwise be prepared for exceptions ;-)
Comments:

It seems only 4.0ml and 4.2 nightly sources are available at netbeans.org, but not 4.1?

Posted by Torgeir Veimo on červen 08, 2005 at 01:09 odp. CEST #

So thanks. I have donwloaded latest Java. I played little. But I didn't found any changes on display. And it was my mistake. I didn't found how to switch it on. :-) Btw. I have notebook. Don't you know, which type of connection they usually use DVI-A or DVI-D to connect internal graphics with internal display?

Posted by Wincent on červen 08, 2005 at 01:12 odp. CEST #

4.1 daily builds were moved to the archive. I wonder why the 4.0 multilanguage builds are still there. Maybe there's some reason...

Why do you need 4.1 daily builds anyway? Everybody's working on 4.2 now.

Posted by Roman Strobl on červen 08, 2005 at 01:12 odp. CEST #

Wincent, I have no idea. Google returns more results on "internal display" DVI-D than on "internal display" DVI-A. I would say DVI-D than :-)

Posted by Roman Strobl on červen 08, 2005 at 01:15 odp. CEST #

@Wincent:

Did you turn on "Text Smoothing" in Windows'
Display Properties Dialog (Display Properties/Appearance/Effects)?

After if you set the smoothing to ClearType or Standard, Java 6.0 b39 will pick it up and
standard Swing components will be rendered with 
LCD or GASP AA respectively.

If you're on Gnome, you can enable LCD-aa in Fonts Prerefences.

KDE is not supported (yet).

Thanks,
  Dmitri
Java2D Team

Posted by Dmitri Trembovetski on červen 08, 2005 at 02:28 odp. CEST #

http://www.googlefight.com/index.php?lang=en_GB&word1=internal+display+DVI-D&word2=internal+display+DVI-a :-) But another mistake in me. I got Java b38. That havo no such RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB. Certainlly I have ClearType on. I am addicted to that technology.

Posted by Wincent on červen 08, 2005 at 05:30 odp. CEST #

Hello My opinion, subpixel rendering or anti aliased fonts are not good for IDE's. i actually like the crisp look of normal Java fonts there. sure, Anti aliasing is perfect for end user applications imho :)

Posted by aaa on červen 09, 2005 at 12:04 dop. CEST #

It depends - some people like it, some don't. As you can mention from my screenshots of features I mostly don't use antialiasing, but we want to make sure people who like it can have it in NetBeans.

Posted by Roman Strobl on červen 09, 2005 at 02:34 dop. CEST #

Very funny googlefight :-) Yes, DVI-D won.

Posted by Roman Strobl on červen 09, 2005 at 02:34 dop. CEST #

Sorry but i'm not able to use new anti-aliasing effect on NetBeans. I have see your "tutorial" but when I start my NetBeans a lot of Exceptions will occur. I have downloaded the last version of JDK 6.0, NetBeans 4.1 (and also 5.0 Beta but it doesn't work) So please can you repeat each links where I have to download files, and all the procedure to anti-aliasing my NetBeans??? Thanks :)

Posted by Ale500 on říjen 21, 2005 at 05:18 odp. CEST #

To obtain subpixel hinting antialiasing in netbeans, using JDK 1.6 add the following text to the netbeans_default_options line:

-J-Dawt.useSystemAAFontSettings=lcd

It looks even better than using -J-Dswing.aatext=true

Posted by Awef on březen 02, 2008 at 08:37 dop. CET #

Thanks for all!! Editing netbeans.conf file, it works! :)

Posted by ale500 on březen 02, 2008 at 11:49 odp. CET #

Post a Comment:
Comments are closed for this entry.
About

Roman Strobl

Search

Archives
« duben 2014
PoÚtStČtSoNe
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today