Consolas is a poor choice for web use

— richardwb on Monday, July 06, 2009 @ 15:22

Consolas, with ClearType enabled, is a gorgeous font, and is my preferred monospaced font. However, take a look at it without ClearType (there's a sample image on the linked Wikipedia article)---those jaggies hurt.

That's why you shouldn't define Consolas in your style sheets. You can't know/assume that everyone who views your webpage will have ClearType on (or at least some form of font-smoothing), and those who don't have it enabled will suffer through text that looks as though it were drawn freehand with a mouse.

Instead, unless you are going for a specific effect such as trying to mimic old terminals, keep your font-family for <pre> and <code> elements short and to the point. I personally use

font-family: "Lucida Console", "Monaco", "DejaVu Sans Mono", monospace;

which is usually enough to keep Courier (+ New) out of the way. If someone is missing all of these fonts they'll likely have a decent enough substitute.

comments powered by Disqus