Turning off text anti-aliasing with NetBeans 7.0 on OS X
Posted: May 2nd, 2011 | Author: Alex Korn | Filed under: Uncategorized | Tags: fonts, Mac OS X, netbeans | 3 Comments »See the updated post for NetBeans 7.1 and 7.2.
The quick version
For those who want to turn off text anti-aliasing in NetBeans 7.0.x on Mac OS X without reading my tirades, just make the following changes to the definition of netbeans_default_options
in /Applications/NetBeans/NetBeans\ 7.0.app/Contents/Resources/NetBeans/etc/netbeans.conf
(or something similar if you didn’t install it in the default location):
Add:
-J-Dswing.aatext=false -J-Dawt.useSystemAAFontSettings=off
Change:
-J-Dapple.awt.graphics.UseQuartz=false
Restart NetBeans and you should have non-anti-aliased fonts.
The full story
The perfect programming font: many have searched; few have found.
It’s Monaco, 10pt, no anti-aliasing.
But I digress. My goal here is not to discuss fonts (but seriously, I love discussing fonts), but to write the most keyword-heavy post for those trying to figure out how to turn off text anti-aliasing in NetBeans 7 on Mac OS X. By default, NetBeans uses anti-aliasing for its editor, which, for most fonts, is great, but not for Monaco 10pt.
When I used NetBeans 6.x, I found this page to be quite useful. However, when I tried turning off anti-aliasing with NetBeans 7.0, it did not work.
After a bit of exploring, I found the key to be setting -J-Dapple.awt.graphics.UseQuartz=false
. I believe Quartz refers to the 2D graphics rendering API for OS X, but for the sake of your non-anti-aliased font, you certainly don’t need it.
In-Application Setting
NetBeans has been well aware of the issue for quite some time, so don’t expect the anti-aliasing setting to be modifiable inside the application any time soon.
You may have seen this excellent article on programming fonts recently http://hivelogic.com/articles/top-10-programming-fonts/ I’ve been a monaco user for years and only recently have begun to see some fonts on the side. Per the article I’m giving Inconsolata a go around for the next couple of days.
The ‘-Dswing.aatext=false’ property is obsolete as of Java 1.6 so you can just leave it out. Once, you disable Quartz with ‘-Dapple.awt.graphics.UseQuartz=false’ you can use different setting for ‘-Dawt.useSystemAAFontSettings’, my favorite is ‘lcd’ which enabled sub-pixel AA, the font looks very slim and clear but without rough edges.
skoczko – I tried this out (I have Java 1.6.0_26 installed) and it didn’t work. I still needed ‘-Dswing.aatext=false’ and ‘-dAwt.useSystemAAFontSettings’ as ‘lcd’ looked the same as ‘off’.
Any hints as to what I may be doing wrong?