Friday, December 10, 2010

JAVA IDE Fonts

I hate how Java based IDEs like JDeveloper 11g, NetBeans 6.9 look on Windows. The fonts are always thin and too small. A small issue it might be, but when you spend a significant amount of time in front of one, it gets to you. You need to fix 2 different aspects: Font size and font face.

Font Size: Usually I use 10-12 point fonts in Word documents, which in a swing app will look far too small. For a similar size you will have to use 16 pt. Apparently this is something to do with how DPI is used/calculated.

If you want the font to look reasonably thick, you end up increasing its height too much. Apparently this is not so much of an issue on OSX, but more of a Windows and Linux issue. Something to do with the way fonts are drawn by the JRE. Apparently Apple did a better job in their JRE implementation that Sun did.

Googling around I found a few things, which I thought can help fellow developers like me.

First JDeveloper 11g. Chris Muir had blogged about setting up the default size. On Windows 7 the location of the ide.properties will be in
C:\Users\\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.jdeveloper\ide.properties
Edit this file only when JDeveloper is not running or else you find your edits over written when the IDE is closed. You can set the default font size.

Setting font size in Netbeans is well documented here.

Font face: I am just not happy with any of the fonts on Windows, because they always look scrawny. Again googling brough up this excellent post about Inconsolata. I had to install the TTF version before NetBeans was able to use it. The improvement was rather satisfying. On trying to set JDeveloper preferences however, lead to a unusual situation. The font would not show up on the list. I tried various things and gave up. Trying to fix it the next day, however, I was able to see it in the list. I am not sure if it showed up after I had switched off on the Display only Fixed Width fonts and rebooted the IDE or it was already there and I had not noticed it. Anyway, problem solved.

No comments: