programmingFonts()
Posted by Stefan Camilleri on {2008.July.12}
/** So, the never-ending debate as to which is the best typeface to use for programming has also started brewing in my brain. */
I found tons of posts on-line debating what was the best font, and for one, I always felt that Microsoft’s Consolas was by far the best programming font around (and technically it is almost, but not quite, entirely like the best coding font around).
To summarize what sparks the requirement of such a font, it basically boils down to {
- Programmers like fonts that look good at SMALL point sizes. Not because we are masochists (well some of us probably are), but because we want to see as much code as possible on one screen. Which would also explain the phenomenon of why all programmers push their graphics cards to the highest resolutions possible (oh yes, and it also looks gorgeous on a hi-def lcd).
- We spend hours on end reading funny words that make sense solely to us and to lexical analyzers, so we need the font to be VERY legible, and to distinguish clearly among similar characters like 0,O,o, ilL1… among others (oh yes, and the myth is true, most developers, after a full day of code, go home to see…more…code!)
- We use words like ’sexy’, ‘perfect’ and ‘elegant’ to describe an algorithm, so we should also be able to use such terms to describe the font we use to write such algorithms in.
}
So, to cut it short, here are the contestants {
}
And that is it really. I have concluded that for now, after testing all these fonts, Consolas remains the one of choice for me. ProFont was terribly inviting, yet the boldness of the font is just way too heavy in comparison to the normal formatting.
Now I’m just hoping to find a font which looks as good as Consolas does in 8pt, but at 7pt, since 8 is just a bit too big for my likes.








Glenn said
Ok, as a ProFont fan, ProFont only works if:
1) You turn off ClearType to ensure it’s as crisp as possible (which makes Consolas unusable.)
2) Your resoultion ain’t too high such that it makes the font too tiny.
3) Your IDE *doesn’t* use bold-facing. (Im a Dreamwever/FlashDevelop/Flash guy) so ProFont works well for those, esepcially with the split views and small fonts are nice to use with those, and bold facings aren’t used.
4) 9pt, 96 DPI standard monitors.
I wish I could like Consolas too. It’s attractively good and effeciently spaced horizontally. But if your monitor ain’t good enough for ClearType AA, then it’s out (I can’t get Consolas to appear sharp on my monitor if I use a tiny font size, which means based on your criteria (and mine criteria as well), I can’t use Consolas.)
Somehow, ProFont works great given the above 4 criterias, and is still the most well-balanced readable tiny font I’ve seen to date.
Glenn said
So, yes, you’re right that ProFont is terribly inviting..and i understand perfectly. I’ve used it and never complained given the above 4 conditions. It’s just that ProFont was only intended to be used 1-way, and it meets it’s intended purpose very well. I suggest you give it a try. It can make your messiest program appear somewhat “uncannily neat and understandable”, due to it’s awesome readability. But yea, perhaps not on your IDE or system
. ProFont is the best programming font in my book, but it only works the way it was intended to be. No bolding definitely. No AA. Just the default package. It’s because of this limitation, that’s why the font is so strong in what it does specifically.
In the mean time, if you have tips on getting Consolas to work at small tiny font sizes (so i can view whole chunks and see how “understandable” an entire program is compared to ProFont, I would be happy). But I doubt it’ll win ProFont because I tried Consolas on FlashDevelop at medium size after using ProFont (small), and man, it was a big difference in “code understandability” (Of cos, this is an unfair test because of the difference in font sizes). But somehow, ProFont has ALWAYS propotioned and spaced everything out so well, even though it’s a tiny font. Consolas made that same piece of code tight and messy. What system specs you using for Consolas, anyway?
Caxaria said
You should try the Inconsolata…
check it here http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx
Glenn said
Anyway, i tested Consolas on my home Windows Vista and it works great, and in various ways, better than ProFont. Sometimes, ProFont still brings out the coding structure better because the characters are more spaced out (including the spacings between various braces/brackets/commas, etc.). If your code doesn’t space things out automatically for you, (or you tend not to indent/align your variable declaration values) than ProFont is great for maintaining readability, while Consolas tends to encourage programmers to space things out when necessary, since the fonts are compressed and compacted horizontally by default, if you don’t, you’re asking for crowded and overly tight code. But for a better overall programming font, I can see why Consolas is so much better. With the ClearType on (necessary in Vista), yes, ProFont isn’t too bad if your LCD monitor is good enough, but artifacts such as the loss of color definition and a blurry semicolon, does put it at a slight disadntage. Additionally, Consolas is much more compacted compared to ProFont, allowing you to scroll less horizontally and vertically. You can adjust font-size on the fly, and it looks real cool in italic! In fact, it’s worth an experiement to code in solely italic style using COnsolas (even though the L vs l is problematic..or a mixture of styles such as bold+italic for certain highlights). On my office Windows XP system, though, I’ll have to stick to good old ProFont, since my monitor resolution ain’t high enough to support crisp AA with ClearType and thus would come out rather blurry on my system, particularly with small font-sizes. So, it’s still ProFont in my office, or until i get a proper flat-screen monitor that can support higher resolutions, than Consolas can be used.
Stefan Camilleri said
Hi Glenn.
Yeah I see your point vis-á-vis turning off cleartype, it certainly makes the font look so much better. Yet unfortunately I like cleartype, and turning it off just for one program is a bit of a hack for me.
As for the resolution part, well, I’m one of those who like the top resolutions, I love the desktop estate they provide, and the amount of code that I see in one screen, so that too isn’t really an option for me.
I tested the ‘messy program’ idea you mentioned. Hehe, you’re so right, ProFont with aliasing off tends to make it look more bearable!
Consolas works for me simply because I’m a bit of a perfectionist and align and indent all my code according to best practices (in my case, currently, Java best practices). My only quibble with Consolas is that it has that 8pt limitation. ProFont dimensions are just perfect for 7pt, and in fact I think I’ll give it a shot and try to disable all bold formatting via the ide.
As for Caxaria’s comment, I tried Inconsolata, and no, it is not good. Unfortunately, even though it’s 7pt is great, it is hopeless with AA, and, me again, being a tad pedantic in everything, the jagged edges on a typeface are not pleasing at all.
So currently for me, it’s Consolas that remains ‘almost’ the winner, though I’ll do a non-bold ProFont stint quite shortly.
Glenn said
A comparison between ProFont and Consolas.
http://home.graffiti.net/kidopreneur/profontVSConsolas.jpg
Basically Consolas IS better overall, but both scores are pretty much the same anyway so it doesn’t exactly matter. But I personally still prefer ProFont. It feels better for me and fits the type of snippet-style programming I do. Line by line clarity is definitely better with Consolas, but structural, numerals, parametric and “big picture” clarity tends to shine better in ProFont. It depends on your needs. But generally, I’ve never exactly liked tall narrow fonts because it feels very bookish (like those programming books once studied), while wider base fonts tend to feel more parametric, speedy and “executionistic”. It’s the mood and flow which in which tall narrow fonts don’t exactly suit certain types of programming. Narrower tall fonts means you are the type of person that is careful with horizontal highlighting and studies code in-depth line-by-line…while wider fonts means you are the type of person that likes to quickly double-click or sweep highlight values/chunks horizontallys, aquiring targets faster compared to the narrower font which is “harder to hit”.
Stefan Camilleri said
@Glenn
You are oh so correct. I’ve been trialling ProFont for a day now, and even at 7pt, it’s grown on me… and I’m not going back.
I guess my original impression was only based on initial shock at the difference, but this is simply an impressive typeface.
Glenn said
Profont and Consolas is more an issue of whether you prefer tall fonts which emphasise “linear sequential vertical flow” or wide fonts which emphasise “structural parametric horizontal flow”. I like the Verdana type-face, and Profont is similar to that. It has never dissapointed so far, though there are many aspects of ProFont which i wished could be improved.
Battle of the 2 small fonts: Profont and Proggy
—————————————————
As for ProFont vs Proggy, there are obvious reasons why I find Proggy worse considering Profont’s strengths. Though Proggy’s individual character shapes are easier on the eyes compared to ProFont, Proggy’s characters aren’t spaced consistenly and tend to collide (imo, a badly done typeface which needs “fixing even though the author insists it was “intended” to give it a sense of proportion, though imo that defeats the purpose of monospace fonts.) Line-spacing also isn’t very consistently well-spaced. The result is a program that structurally looks messy when your code gets more crowded & complex. Some characters could be improved as well. As for Profont, it’s consistently good (definitely professionally done) regardless of what programming/markup structure you’re using. Some have complained it’s a bit too wide, but at least, it’s of consistent-spacing, and sometimes, Proggy is guilty of that as well. The main issue with ProFont vs Proggy is that ProFont’s individual characters could be easier on the eyes like ProggyClean and ProggyTiny is. ProFont’s blocky and tiny characters, though very readable and crisp, is more stressful on the eyes compared to Proggy’s cleaner and more open-shaped characters. I don’t rule out a possibility that ProFont can be in some ways be more “tiring” considering it’s tinyness, impersonal and blocky shape, but it’s an effective font for what it’s supposed to do to create a sense of blockiness, structure and compactness that fits programming. Honestly, after trying both fonts, I’m wishing to create a custom small font that leverages on both Proggy and ProFont’s strengths (ie. Profont with Proggy characters…hmm…though it may be hard to harmonise the 2. ).
Glenn said
I also just realised from the screenshot that the resultant width of ProFont at pt9 vs Consolas at pt8 are actually equal, even though Consolas is a narrow font. In short, both have equal horizontal compactness rating. Thus, Consolas should score should dip below 4.6/5. Consolas does have better sementic clarity, no doubt, and is a very suitable type-face for presentations and books. As for programming, it’s up to the coder’s personal taste, and I don’t mind Profont’s impersonal blocky structure as long as it gets the job done.
Glenn said
I’ve given up on Consolas already. I realised it isn’t that much different from the array of other tall fonts out there (Bitstream Vera Sans Mono, Andale Mono, etc.). Consolas is just more compact. But sementic readability and neatness is still dissapointing and forcing one to use ClearType for blurrier small fonts rather than crisp small fonts, i’d rather prefer the latter.
So, it’s back to crisp small fonts. Will ProFont still maintain the title? It depends. I’m afraid not.
BATTLE OF THE SMALL FONTS
http://home.graffiti.net/kidopreneur/battleofsmallfonts.jpg
In this situation, Anonymous really comes in on top for me. And ironically, it wasn’t intended to be a small font to begin with, yet turns out to be a potentially great programming small font.
Anonymous is well known to be artistically nice. Yet, it’s mono-spaced. It’s known to have some weaknesses, though particularly with ClearType and general clarity/cramp collisions with touching underscores and some characters. Thankfully, in this situation without ClearType and in FlashDevelop (together with some cool dark color settings), Anonymous shines really well.
The Contender/Runner-Up reviews
———————————
2nd place: ProFont
ProFont’s strenghts vs. Anonymous
ProFont has always been the MOST consistent in character spacing and the characters NEVER touch. This results in a very neat, blocky font that makes your program look EXTREMELY neat and in real good order. But it’s true that spacings can be a bit too wide such that ease of readability does suffer somewhat, involving a certain degree of strain. ProFont’s “wide consistency” is both a strength and weakness. Compare it with the other fonts where whose characters are closer together and therefore easier to read. Also, Anonymous have defined serifs which really adds to sementic meaningfulness and allows the user to read much faster than you would with ProFont, yet still maintians a consistency. But this consistency is known as “compact consistency”, something which ProFont lacks severely. Which do we prefer? One which look “cleaner” but strains the eyes more, or the other which may look “crowdier” but is faster/easier to read? Frankly, the latter seems like a better a option.
Anonymous might seem more cramped/messier unlike ProFont’s neatness, but it’s compact and very readable because of this situation. When i tried reading over ProFont or Proggy, I couldn’t absorb as much meaning as quickly as I could with Anonymous. Somehow, Anonymous truly brings out the personality of individual words really well, and on the whole, brings out the structure and meaning of the program FAR more than what ProFont will ever have. When viewing in ProFont (and Proggy as well), those fonts seem far more impersonal, and it’s hard to draw out sementic meaning quickly with those fonts. Yet with Anonymous, it really has the tendency to make this chunk of “meaningless code” appear as understandable as plain English. Only Anonymous smartly differentiates out the variables vs. numbers vs. operators very well. I’m extremely impressed. Anonymous also shows why serifs really add sementic meaning to a chunk of code. Maybe that’s why even the notoriously “ugly” Courier New is still being used as the default font in most IDEs, and why it’s generally readable and easy on the eyes as well. With mathetmatical calculations such as these, Proggy and ProFont comes out as meaningless garble while Anonymous shines in readability and understanding.
So yes, Anonymous may look not as neat and lean compared to ProFont. But try reading and understanding those math calculations with ProFont. Which is easier? Anonymous turns out easier for me.
3rd place: Proggy
Proggy’s main weakness:
Proggy is inconsistent in it’s spacings. Sure, both Proggy and Anonymous collide, but Proggy is inconsistent unlike Anonymous which still maintains a “tight compacted” consistency. Honestly, Proggy is really like a buggy font imo and I wonder why some people might like to use it. Sure, the individual glyphs are very clean, attractive and easy on the eyes, but that’s it. The entire typeface seriously needs improvements/fixes.
Why more Anonymous?
——————-
Anonymous also allows you to work in the super-compact pt 6, the smallest font-size i’ve ever seen. And guess what? It’s still just as readable, neat and sementically meaningful! Check out the screenshot.
http://home.graffiti.net/kidopreneur/anon6pt.JPG
I really wished the author could create a version of Anonymous that works crisply with ClearType as well. The serifs really make my day, and makes a GREAT difference to small font readability. There are many cases I’ve seen Anonymous not work the way it should, but it works here. Imo, it’s the best programming font (at least) in this situation. Hope you have some luck with this font.
Scores:
Compactness – Anonymous wins
Sementic Readability – Anonymous wins
Neatness & Structure – Anonymous and ProFont tied.
How to Get Six Pack Fast said
I can tell that this is not the first time you mention the topic. Why have you decided to write about it again?
Mark said
Thanks for the advice about font use people. It would be much easier to select a good font, if browsers display them exactly too.