Typophile

Typeface for computer code

danburzo

Hello everyone.

I am writing a technical book about web development, and it will include a considerable amount of CSS and HTML code examples. What are some good typefaces to set this text in?
The basic requirements here are that it be monospaced and readable.
I noticed that some popular choices are Monaco and Andale Mono. What other alternatives are there?

You can try BPmono (normal or italics) :-)

George Triantafyllakos - backpacker.gr

Andale Mono is excellent. Here a few others that I highly recommend: DejaVu Sans Mono (which is an improved version of Bitstream Vera Sans Mono), Droid Sans Mono, and Consolas.

(I am a coder who spends many hours a day staring at code, both on screen and in print, so I have strong opinions about which fonts are good.)

Whatever you do, just don’t let Wrox publish it. I’ve never seen technical books with more horrid typography and lack of proofreading than Wrox.

Thank you for your suggestions! I will look them through.
@aluminum: I am pretty sure Wrox doesn’t have a local branch in Romania :) And indeed, their books can sometimes look rather uninspiring.

I am trying to do most of the work by myself, including typesetting and illustration, partly because I enjoy doing it, and partly because it’s an opportunity for me to develop some new skills.

After searching the web for additional information, I found this thread over at Typographica. Lots of great information!

I’m also considering TheSans Mono by Luc(as) de Groot. Seems a pretty nice typeface.

In case you didn’t already know: Consolas is a more recent design by Lucas de Groot.

I second Consolas, fine!

 If you’ve seen Bjarne Stroustrup’s The C++ Programming Language, there’s a very respected example of code extracts not set monospaced.
 If you’ve your heart set on monospaced fonts though, Raph Levien’s Inconsolata (Typophile thread) might also be worth a look.
—Joel

Everson Mono is very nice!

I like using Luxi Mono, since I’m particular to serif faces. As far as I know, this is easily the best (free) serifed mono. Lightyears from Courier.

Captured from web.archive.org on 3 Jan 2008. view this capture