disabling anti-aliased fonts in netbeans on osx 6

Posted by peter on December 08, 2009

it’s harder than you might think, and i haven’t found a perfect solution, but i’m pretty close.

in eclipse, likely because of swt’s use of jni to use os-native forms, you can simply set an application-specific anti-aliasing threshold for the application:

defaults write org.eclipse.eclipse AppleAntiAliasingThreshold 20

and this more or less works (thanks to tim for pointing this out here), but with netbeans, no joy.

our buddy netbeans uses swing, which doesn’t look at application property plists. since apple rolls their own ui elements for swing/awt on osx (best of my knowledge), we’re in strange waters, as well. there’s a hackier way to do this, documented here on the netbeans forums for netbeans 6.5, and involves appending the following flags to netbeans_default_options in the netbeans.conf file inside the netbeans application bundle- that’s .../NetBeans\ 6.7.1.app/Contents/Resources/NetBeans/etc/netbeans.conf

-J-Dswing.aatext=false -Dawt.useSystemAAFontSettings=false

and this works fine and dandy, if you’re using the standard “Monospace” font.

netbeans 3.7.1 using monospace on 10.6

However, this fails miserably if you’re using something else, like profont or (my pick) pragmata. in that case, at least if you’re on 10.6, you get a mess that looks like this:


note that fonts are being drawn on top of each other. selecting text and moving the cursor around makes for an even bigger mess.

i’ve noticed that apple’s release notes contain a note saying that the swing.aatext system property was ignored in apple’s first release of java6 on osx, so my guess is that either they didn’t get it quite right, or that netbeans is getting rendered glyph sizes wrong. my money is on this being an apple screwup, as it works great with the default monospaced font, but this is also me talking out my ass as i haven’t bothered even looking at how this works in another swing application.

this is the point where i give up and admit that i’m spending more time than i should on getting my special font working. if anyone else has any clues past this point, i’m all ears!


Use this link to trackback from your own site.


Leave a response

  1. markt Thu, 03 Jun 2010 16:41:37 UTC

    Thanks for this post! Editing netbeans.conf seems to work fine for Netbeans 6.8 with Monospace font as well.

    BTW, what color scheme are you using in the screenshots above? I’ve been looking for a decent dark theme.

  2. peter Tue, 13 Jul 2010 19:17:20 UTC

    hello! very late reply.

    i’m using the theme “dark pastels” that i grabbed from here: http://blogs.sun.com/tor/entry/ruby_screenshot_of_the_week19

  3. Dr. Parkash Gill Mon, 05 Oct 2015 04:48:01 UTC

    So I was stuck at my wits on what to look for and was just about to give up entirely when I came across your post. I really hope the best for you in business.

  4. Josephcep Fri, 18 Nov 2016 16:14:06 UTC

    online store – books to buy online, buy epub books.

  5. our website Sat, 03 Dec 2016 02:11:13 UTC

    Do you have a good sense of humor .
    our website https://plus.google.com/+Upalbion_com

  6. RobertNoime Fri, 01 Sep 2017 16:50:45 UTC

    red website torrentdownloads