34

Is it possible to make Gmail display messages with only text/plain content using a constant width font? To clarify, I'd still prefer multipart/alternative messages with an HTML part to be shown in HTML mode. (In other words, just like Thunderbird does it.)

I receive some plain text messages with table-like formatting, which obviously depends on constant-width font. Gmail breaks the formatting like this:

alt text

I would want something like this, of course:

alt text

(Showing messages matching a certain filter (or tagged with certain label) in fixed width would be an equally good solution here, so if that's possible, please let me know!)

I looked around Gmail settings, but couldn't easily find anything related. The "Show original" option is a work-around, but it's rather clumsy if you always have to do that.


This is a repost of an old (unresolved) Super User question (Google cache). I would have rather migrated it to Webapps, but that's not possible as it seems delete-happy SU moderators have recently removed it altogether for some reason.

13

Update 2019-07-15:

The gmail-fixed-font extension is now hosted on github: https://github.com/jparise/gmail-fixed-font

The instructions are provided in the repo README, but to summarise (assuming you are using Chrome):

  1. Download the script
  2. Open a new tab and navigate to chrome://extensions/
  3. Enable Developer Mode
  4. Drag and drop the script onto the window and install
  5. (optional) you may want to allow the extension only for the gmail domain by clicking Details > Site Access: On specific sites and enter https://mail.google.com in the dialogue box and save

Ok, you have to try Gmail Fixed Font userscript

// ==UserScript==
// @name           Gmail Fixed Font
// @namespace      http://www.indelible.org/
// @description    Fixed-font message bodies for Gmail
// @author         Jon Parise, James Tunnicliffe
// @version        1.3
// @include        http://mail.google.com/*
// @include        https://mail.google.com/*
// @include        http://*.mail.google.com/*
// @include        https://*.mail.google.com/*
// @grant          GM_addStyle
// ==/UserScript==

// Plain-text Message Body
var css = ".ii, .Ak { font: medium monospace !important; }";
// Compose Interface
css += ".editable { font: medium monospace !important; }";

if (typeof GM_addStyle != "undefined") {
    GM_addStyle(css);
} else if (typeof addStyle != "undefined") {
    addStyle(css);
} else {
    var heads = document.getElementsByTagName("head");
    if (heads.length > 0) {
        var node = document.createElement("style");
        node.type = "text/css";
        node.appendChild(document.createTextNode(css));
        heads[0].appendChild(node);
    }
}
6

If you are using Chrome, the Gmail Fixed Width Text extension takes care of it.

  • 1
    +1, good to know, even if this doesn't do exactly what I want (it uses fixed width also for multipart messages that do contain a HTML part) – Jonik Jan 5 '11 at 14:30
  • 3
    This doesn't seem to work with the new Gmail compose. – 6005 Feb 17 '14 at 16:38
4

Next you can choose "Reply" or "Forward" and change Font to Courier New.

  • 1
    Frankly, this seems clumsy. Even the "show original" workaround (mentioned in the question) is handier, and what I'm looking for is something automatic... – Jonik Jan 5 '11 at 14:33
4

This was driving me nuts but I only wanted monospace for certain mailing lists and wanted to be able to adjust font-size too.

After looking at the existing solutions and suggestions I ended up creating a new Chrome Extension (free & open source) that applies CSS properties by GMail label. I already had GMail rules to apply labels to my mailing list messages so this worked well for me.

The CSS selectors & logic should be more reliable than the .ii, .Ak mentioned in other answers. You can apply different style properties for the message view and the reply/forward editor.

You can use the published version in the Chrome Web Store or install from source in developer mode.

Source: https://github.com/mscalora/GMailStyleByLabel

Chrome Web Store: GMail Label Styler

  • If only this applied to the editor when replying – Pawel Veselov Jan 19 '17 at 21:30
1

If you use any custom CSS extension, such as Stylish or my favorite, Stylebot, you can just paste the CSS used by the userscript above:

.ii, .Ak  { font: medium monospace !important; }
.editable { font: medium monospace !important; }

Still working as of 2017

  • Doesn't seem to be quite enough in 2019 ... – SamB Apr 12 at 2:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.