Maybe I’m just a crotchety, old-school, Jolt-drinking, amber-on-black, command-line code junkie, but for the last 2 years I’ve been so frustrated that I just can’t get my code font in Eclipse / Flex Builder on Mac OS X to be aliased! Those little smooth edges on my fixed-width bitmap fonts drove me to irrational madness. Well, I had given up and moved to PC, but I’ve had Mac laptops throughout, and I finally took some time to solve this little pet peeve. If you share my frustration, read on.
Arrrgh!
Ahhhh…
As far as I can tell, there’s no way to turn off anti-aliasing in the Eclipse preferences, or in OS X’s Java preferences. Eclipse will insist on anti-aliasing even a perfectly fine bitmap font at its natural size.

The only way I saw around this was to “Turn off text smoothing for sizes N and smaller,” in the Appearance pane of System Preferences. Of course I could sacrifice all anti-aliasing globally by turning it off here, but I do like nicely AA text when I’m not writing code. My preferred coding font, the excellent Proggy Square by Tristan Grimmer (available free at www.proggyfonts.com), appears pixel-for-pixel at a point size of 16. Disabling anti-aliasing for fonts smaller than or equal to 16pt was clearly not much better than globally disabling it.
So, all I did was a fairly stupid hack. I opened up fontforge, an incredible open source font editor, scaled up all the glyphs in the font to 400%, changed the name of the font so it could coexist with my original Proggy Square, and saved it out. Now I have Eclipse use my modified Proggy Square Huge at 4pt for code text — the same visual size as it was before at 16pt — and I have disabled anti-aliasing for all fonts 4pt and lower, which is completely reasonable, as anything but an intentionally broken font would appear illegible at that size anyway.
You can apply these steps to your own monospace font of choice to overcome this limitation in Flex Builder / Eclipse / Java on OS X. Or, you can download my copy of Proggy Square Huge. All credit for this font goes to its creator, Tristan.
Download Proggy Square Huge (OTF, works on Mac/Win, 34K).
Hah! I’m glad there’s someone else out there who prefers to not to anti-alias pixel fonts. I’ve settled for the System Prefs / Appearance pane global fix, but this is a clever alternative…
If there’s interest I can post a step-by-step guide with pictures. I just need to get back home to my laptop for screenshots :)
I was also looking for a solution. Thanks
suh-weet! thank you so much for taking the time to post this.
Oh but there is a way to turn off anti-aliasing. Open Terminal and run this:
defaults write -g AppleAntiAliasingThreshold 128
where 128 is the font size below which nothing is anti-aliased.
John, that’s an excellent hint, but it does control antialiasing globally, just like the Appearance panel. However, this tip gets you a lot closer to an actual solution.
To disable antialiasing for all fonts in Flex Builder, you can type
in the Terminal. Using this method, you can set antialiasing on a per-application basis. However, since the code font I use has a higher native point size (16) than the point size used in the UI (12), both will appear aliased. This may be acceptable for some.
You should be able to solve this problem entirely without the use of custom fonts with the
AppleSmoothFixedFontsSizeThresholdproperty, which sets a seperate threshold for antialiasing monospace fonts:However, this is not respected by Flex Builder, even if the property is set globally, or you would have no problems in the first place.
I’m still sticking with my solution, until Flex Builder (or is it Eclipse’s fault? or Java’s?) starts respecting the
AppleSmoothFixedFontsSizeThresholdflag.Hi Roger,
Thanks for this tip. I tried to go ahead and do this myself using Monaco (my preferred programming font).
Not 100% sure of the steps involved in fontforge, but I opened Monaco, selected all the glyphs, did a scale of 250% (Monaco appears pixel-pixel at 10pt), went to Font Info to change the name of the font (which then asked me to generate a new UID or keep the existing one), chose to generate a random UID, saved as OTF.
Font Book won’t open the font though, but it did when I didn’t play around with Font Name / UID. Problem there is that it installed a Monaco in my user fonts, which is going to conflict with the system Monaco font.
Any tips?
Cheers.
@Raf,
I attempted to do the same thing with the Monaco font. I managed to push past your problem.
@Roger,
I figured out a set of steps, but the results look pretty bad. I’m not sure what I’m doing wrong.
Steps that I did:
1. Install fontforge
2. Open /System/Library/Fonts/Monaco.dfont
3. I selected the “10 pt font” for the bitmaps (?)
4. View->10 pixel bitmap
5. Element->Font Info…
6. Change all three entries to “BigMonaco”, click ok, click “change”
7. Control-a to select all
8. Element->Transformations->Transform…
9. Change Origin to “Glyph Origin”. Click the second combo-box to select “Scale Uniformly…” and enter the value 300%
10. File->Save as… (Save to desktop)
11. File->Generate Fonts… Again, selected my Desktop directory. Made format “OpenType (Mac dfont)” and “In TTF/OTF”. Click Save.
12. Double-click on the BigMonaco.otf.dfont file on the Desktop
13. Choose “Install Font”
14. Go into Eclipse and install the font at a small size
Is it just that Monaco is a bad font for displaying without anti-aliasing?
Well, two possibilities are here. One, Monaco isn’t a bitmap font and doesn’t have a natural size. Two, if you converted it to bitmap at 10pt and then scaled it up 300%, its natural size is 3.333333…pt, if you display it at 4pt or 3pt it’s still scaled, which you want to avoid. To get a natural aliased appearance at 10pt perhaps you should scale it 200% and display it at 5pt and turn off antialiasing for fonts under 6pt.
Otherwise, your process sounds like basically the same as mine. Hey, let me remind myself and I’ll do a screencast of this process and see if I can replicate my results from before. That would be really useful.
Hi Roger, I have exact the same problem but using Flash as development tool. I tried your fix but it didnt work for me. I change the Flash preferences to accept font size 4 but Flash change the font to something else. In Flash, when you use Monaco 10 pt (default) font, Flash uses the bitmap font and does not seem to care about the system setting for font smoothing. My problem is that I use the 1920*1200 new MacBook Pro and Monaco 10pt is far to small. Does you or anyone else know how to use a larger bitmap font in Flash without anti-alias but still have the system setting for font smoothing to 8 or less – It would be greatly apprieciated!
/Jens
I’ve always liked ProFont… http://www.tobias-jung.de/seekingprofont/
Hey, i tried your font which looks good in eclipse but bold font seems like you didn’T scale it. That means standard font is perfect but bold is so small that it is not readable. Was there a mistake when you generated the version to download?
Heywood, just set the defaults for eclipse as follows:
defaults write org.eclipse.eclipse AppleAntiAliasingThreshold 20I also had the same problem with the bold font type provided in the example above. This method works a treat.
Thanks SO much for this post. Tim’s comment above about the per application Anti Aliasing worked perfectly for me.
I wrote a little article about my search for my favorite programing font. I eventually landed on ProFont like bob. It’s real nice to not have to switch away from it as I start transitioning from BBEdit to Eclipse. Before I got this anti-aliasing figured out it didn’t look right at all in Eclipse.
thanks for the post, I’ve tried your huge font looks good but as heywood said I think you forgot to scale bold and italics. Can you pls post the font you’re using pleaseee.
Thanks.
Please help, otherwise I’m gonna get crazy.
None of these solutions worked for me.
I tried: scaling the font I use ( Lucida Sans Typewriter ), adding both entries to defaults.
Nothing.
Terminal window displays the same font perfectly, exacly the way I expect.
Any ideas?
Have you noticed the difference (on Leopard) between Monaco rendered in XCode and Eclipse. The Xcode rendering of Monoco is just beautiful. I cannot stand the version Eclipse produces (same font, same size). Does anyone know how produce the Xcode result in Eclipse? Thx
Hi, nice tip, thank you. Unfortunately I can not generate a nice HUGE variant of my loved Terminus font. Anybody a little help for me? :)
Pingback: Netbeans Font Smoothing in OSX
Pingback: Jannis Hermanns' place
If you have the problem that heywood has you can just change the settings of the syntax highlighing, if you use profont, i prefer to set
defaults write org.eclipse.eclipse AppleAntiAliasingThreshold 10
and have only the text in the editor not aliased at 10pt while the text in eg the package view is still aa at 11 pt
I don’t know why people are so down on smooth text for monospaced fonts. Looks great on Anonymous even down to 7pt.
The solution above, that is typing this into a terminal window, worked great for me:
defaults write org.eclipse.eclipse AppleAntiAliasingThreshold 20
Many grateful thanks, to Tim.
Pingback: YAY!MEDIA - Flash Platform Development Blog
Great tips.
Still have an issue though in FB with the scaled font trick…at 4pt most of my code is scaled properly, but any colored keywords are scaled way too small.
Also, my fave coding font has always been Andale Mono….
Pingback: necessary and sufficient » Blog Archive » disabling anti-aliased fonts in netbeans on osx
This is a GREAT solution. I recently got a new MacBook Pro and was experiencing serious buyers remorse. I’ve has tried half-a-dozen different approaches, including calling Apple.
I had already installed Windows XP on the Mac, and was feeling ripped-offed, believing that I code not use the Mac running Mac OS for coding.
This fixes a major issue. I think you, and so should Steve Jobs.