fixed-width fonts in Gmail
July 9th, 2008
i’ve been using Gmail for a while, and have bought completely into their UI (tagging, conversations, search etc). as i mentioned in an earlier post, i even installed Mozilla’s Prism so i could use Gmail as more of a stand-alone app. however, one feature i’ve really missed is the ability to display all non-HTML emails as monospaced (fixed-width font). other mail clients (Outlook, Thunderbird) have this capability, and Gmail even lets you compose emails in a fixed-width font, but doesn’t display them that way as you’re reading them.
why fixed-width fonts? well, for hackers like me, code and “ascii art” display properly in a fixed-width font. fonts like Arial and even Times use different widths for different charaacters, screwing up the original formatting of certain emails. for instance, this:
+ Col1 + Col2 +
---------------
| data | data |
| mmmm | mmmm |
| wwww | wwww |
| oooo | oooo |
ends up rendered like this:
+ Col1 + Col2 +
—————
| data | data |
| mmmm | mmmm |
| wwww | wwww |
| oooo | oooo |
recently, they added a feature through “Gmail Labs” that toggles monospace, but it has to be turned for each and every time you read an email. a global setting would have been much nicer.
so i went searching, and this is what i found:
1) if you use Firefox, just install the “Stylish” extension and add a style for it.
2) if you use Prism, go to the unpacked bundle of the gmail webapp (the one on the Prism site unpacks to a directory called “google.mail@developer.mozilla.org”). in there, create a file called webapp.css (you should see webapp.ini and webapp.js already). add the following to that file:
.geTjV, .ArwC7c, .iE5Yyc, .uQLZXb > textarea {
font-family: courier !important;
font-size: 10pt !important;
}
enjoy.






July 9th, 2008 at 22:01
Nice! Thanks for posting this. I’ve been wondering how to make GMail show monospace fonts by default.
July 9th, 2008 at 22:31
thanks, Rob.
also, here’s a better/updated link for Prism:
http://labs.mozilla.com/projects/prism/
March 27th, 2009 at 11:39
update: looks like google changed their div classes, so it’s time for a refresh, thanks to (http://blog.leosoto.com/2009/03/fixed-width-font-on-gmail-again.html):
@-moz-document domain(mail.google.com)
{
/* GMail messages and textarea should use fixed-width font */
.gs .ii, textarea.dV {
font-family: MonoSpace !important;
font-size: 9pt !important;
}
}