Considering that I plan on using a lot code on this site, I put a lot of thought into the best fonts to use for readability. I ended up going by a programmers font guide from Mr. Lowing. The code highlights on these pages use the following fonts (in order of preference/availability): Bitstream Vera Sans Mono, Lucida Console, Consolas, Courier, monospace.

The result is below:
<?php
if ( ! validate_username($user_login) ) {
$errors['user_login'] = __('This is what the code looks like highlighted');
$user_login = ";
}
?>

If everything went right, it should look like one of the following:

Fonts

If you do not have one of those fonts, you should still see a monospaced font.

  • Welcome to systemBash, a technology and system administration blog by David Drager. If you enjoy this sort of content, can can subscribe to the RSS using the link to the right.