Programming, Elephant style

12 AM November 15, 2005

Just for future reference, if I see a font named “Elephant”, I won’t just assume that it’s a great programming font.

By alang | # | Comments (5)
(Posted to javablogs and Java)


At 12:05, 15 Nov 2005 Richard wrote:

Yep, that's hideous. But it could have something to do with the two anonymous inner classes within 10 lines of code. Shouldn't that clear action code be in its own method, so menus/toolbars/test harnesses can drive it too? And what do you think you're doing overriding paint() in a Swing component? Surely you know it's meant to be paintComponent()! If you were using a modern jdk (1.5 or higher), you could even pass -Dswing.aatext=true on the commmand line, and avoid the override altogether. Java 6 (or 1.6, depending on how strongly you're attached to that 1. prefix, aka Mustang) will finally match its aliasing mode to the OS, eliminating the need for even this meagre flag.

Back to the font at hand, the fact that it's shown up as bold isn't helping its case. Perhaps it wouldn't look so bad if there were some comments in the vicinity? I have a feeling this font is best when there is a reasonable amount of text on screen (as is typically seen in a javadoc comment), and not as much bracket goop. Of course, it's hard to make semantics free code such as this look good :)

The font does have benefits for those who still like their fonts seriffed, and their text widths natural. The monospaced arial lovers (is there a font like this around?) however will never succumb to this font's wiles.

[PS: What time is it on this server? Did it forget to put it's clock back when daylight saving started?]

At 19:04, 15 Nov 2005 Alan Green wrote:

Oh yes, it is hideous. Fortunately, the code only lasted about five minutes before I couldn't stand the thought of it and rewrote it. I saved a copy of it though, as it will make a good interview question one day.

Didn't know about the swing.aatext flag. Thankyou for the pointer.

At 22:53, 03 Dec 2005 Richard wrote:

FYI, Microsoft at one stage provided a monospaced sanserif font called Andale Mono (aka You can get it from them (for $30, from, or from the Core Fonts project (, and legally free-as-in-beer according to the EULA that MS attached), which also has some packages for use under linux.

At 22:11, 08 Dec 2005 Anderes wrote:

Could you by an chance mail me the font, I have been looking for it for a while. Thank you

At 12:42, 09 Dec 2005 Alan Green wrote:

Sorry Anderes, it's an MS font, and the license conditions forbid sharing it 'round. However, if you buy MS Office, you get it "for free".


Add Comment

(Not displayed)

(Leave blank line between paragraphs. URLs converted to links. HTML stripped. Indented source code will be formatted with <pre> tags.)

© 2003-2006 Alan Green