As has been stated in the comments, this is a problem with Java Swing apps on Linux. Swing does use Gnome's font smoothing settings (deactivated, greyscale or subpixel) - it disregards the hinting settings though. It always uses full hinting, and if you're running Ubuntu with little or no font hinting (as most people do since little hinting is the default setting) this will make the font appear significantly different than in other applications. SWT applications like Eclipse are fine, but if you like Netbeans this isn't gonna help you.
Caveat: For the following workaround I'm only talking about the editor font, because in an IDE that's what's important to me. You could also apply it to the menu fonts etc, but that might be a little over the top.
The only usable solution I found here : use Fontforge to edit your editor font of choice and remove all hinting information from the font itself, then save it as a new font and use that in Netbeans.
sudo apt-get install fontforge
- Launch Fontforge
- Open your font of choice
- Ctrl+A or
edit -> Select -> Select all to select all characters
- Hints ⇒ Clear instructions
- Ctrl+Shift+F or
element -> font info to open the font info
- Rename font (e.g. to original name + '_nohints')
- Save edited font in the
.fonts directory in your home, through
file -> generate fonts, making sure to use a format that Ubuntu reads (see next step)
- Clear font cache
fc-cache -rv - following its output to make sure your new font file was picked up (e.g.
.sfd doesn't but
- Run Netbeans and use the font you created as editor font
No, not perfect and yes, a bit of a hassle, but still a world of difference. Hope that helps.