dannyman.toldme.com


Technical

HOWTO: Use a monospace font in GMail

2018-08-23 Update: It looks like Stylish has been barred from Chrome. Here’s an alternate extension.

2014-09-05 Update: Revised my Stylish answer

2012-01-09 Update: Note that pimp-your-chrome no longer works due to new Gmail style . . .

2011-04-06 Update: Added some additional options . . .

So, I have mixed feelings about GMail, but it is mostly good enough. However, if you are a system administrator, you find that the ability to render plaintext messages in a monospace font is really really important. Messages like this can get very annoying:

gmail-default

It is pretty lame that after these few years, GMail still has no feature to set your preferred font. But that doesn’t have to stop you! These days (2011) there are a few ways to achieve a fixed-width font in Gmail:

gmail-fixed

There are a few different ways to do this:

1) Use Stylish: Stylish is an extension available for most web browsers (but not Chrome!?) that allows users to easily plug in their own style overrides. I posted some instruction on Stack exchange.

2) Gmail Mono: An extension for Google Chrome. In 2018, this is what I use. Braindead simple:

https://chrome.google.com/webstore/detail/gmail-mono/cockeompoklmhodfbhbmnphfhpogmnbf

3) This last part no longer works with the new GMail style! Pimp your chrome: This is a Firefox hack that I committed in 2007. You’re probably happier with one of the above solutions, but you can jump down this rabbit hole if you like.

See: http://3cx.org/item/34

First, you’ll have to find your profile chrome.

On Windows, you can hit Start > Search, go into “More advanced options” and check:

Then, go ahead and search for your Local Hard Drives for all or part of a file name: chrome

Hopefully, you’ll find your chrome folder, which will be named something like:
C:Documents and SettingsdjhApplication DataMozillaFirefoxProfileszzxxzzxx.defaultchrome

On Macintosh, you can just type chrome into the search box in the Finder.

Select the folder with the newer time, which should have a path like:
~/Library/Application Support/Profiles/zzxxzzxx.default/chrome

Having located the chrome folder, open that folder up, and then edit the file userContent-example.css and add the following lines to the bottom of the file:

 
/* GMail fixed-width font: see http://3cx.org/item/34 */
 
div.msg div.mb {
    font-family: monospace !important;
    font-size: 12px !important;
}
 
textarea.tb {
    font-family: monospace !important;
    font-size: 12px !important;
}
 
td.ct {
    font-family: monospace !important;
    font-size: 12px !important;
}
 

Now, do “Save as …” in your editor, and set the file name to userContent.css. Then, restart Firefox, and things should look more awesome.

Since this little hack simply sets the default style for messages, HTML messages should render just as they always have.

Read More

Next:
Previous:
Categories: Technical
Possibly-Related Posts

Responses

March 27th, 2007

oubiwann

Nice, man! Thanks! That’s been killing me, and I finally got un-lazy enough about it to google and found this post. Sooooo much better.

November 24th, 2008

Sergey Martynov

There’s a greasemonkey script, which adds a button in gmail interface to allow you turn fixed font on and off easily: http://userscripts.org/scripts/show/37471

March 13th, 2009

Daniel Grosche

This works just for the old gmail-UI. Is there a way to get those changes also for the new gmail?

January 5th, 2012

Wilson

Sadly, this no longer works in 2011. Anyone have a more current solution?

January 10th, 2012

Daniel Howard

Heya,

So, the Fixed Width Text for Gmail Chrome extension still works just fine.  Has anyone tried Stylish?

The userContent.css is really not going to work as the new email body doesn’t receive a consistent ID upon display.  (WTF?)

If someone finds a better solution for Firefox please shoot me the information!

Thanks,
-danny

Comment

Leave a comment . . .

Tiny Print:

  1. For private messages, e-mail me: dannyman@toldme.com.
  2. You must provide an e-mail address.
  3. You can use a bogus e-mail address, but I like to know who you are.
  4. I will not spam you. I will not publish or share your e-mail address.
  5. First-time commenters will be held for review.
  6. You can use these HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>