X

Subpixel Antialiasing Fontrendering in Editor

Guest Author



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 ;-)

Join the discussion

Comments ( 12 )
  • Torgeir Veimo Wednesday, June 8, 2005
    It seems only 4.0ml and 4.2 nightly sources are available at netbeans.org, but not 4.1?
  • Wincent Wednesday, June 8, 2005
    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?
  • Roman Strobl Wednesday, June 8, 2005
    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.
  • Roman Strobl Wednesday, June 8, 2005
    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 :-)
  • Dmitri Trembovetski Wednesday, June 8, 2005
    @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

  • Wincent Wednesday, June 8, 2005
    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.
  • aaa Wednesday, June 8, 2005
    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 :)
  • Roman Strobl Thursday, June 9, 2005
    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.
  • Roman Strobl Thursday, June 9, 2005
    Very funny googlefight :-) Yes, DVI-D won.
  • Ale500 Friday, October 21, 2005
    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 :)
  • Awef Sunday, March 2, 2008

    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


  • ale500 Sunday, March 2, 2008

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


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.