1

Many websites I visit show source code in Courier. I have ClearType enabled, and any text that uses non-anti-aliased Courier is equally ugly and unreadable in Explorer, Firefox, and Opera.

How can I alleviate this problem for all websites in at least one browser?

Here's a sample of what I have to deal with:

sample screenshot of width

2
  • Should be moved to SO?
    – ricbax
    Oct 24, 2009 at 15:44
  • 3
    No, it's not really programming related.
    – Patrick
    Oct 24, 2009 at 15:51

3 Answers 3

1

You can achieve this with the Stylish add-on for Firefox. It allows per-site user stylesheets. If you don't know CSS, they have an online repository at userstyles.org. Since it appears you are looking at MSDN or a similar site, the MSDN styles may be of interest to you.

Stylish allows easy management of user styles. User styles empower your browsing experience by letting you fix ugly sites, customize the look of your browser or mail client, or just have fun. With an online repository at userstyles.org, you don't even need to know how to write styles yourself; just a couple clicks and the chosen style is applied. Stylish is to CSS what Greasemonkey is to JavaScript, and unlike other methods of using user styles, most styles take effect immediately.

3
  • 1
    I know about Stylish for Firefox and UserCSS for Opera, but I hate Courier so much that I'd rather not see it again anywhere, but these tools don't allow me to globally override Courier. :(
    – Patrick
    Oct 24, 2009 at 15:56
  • Why not copy a font in your fonts folder that you do like and name it courier? Or remove it all together?
    – user1931
    Oct 24, 2009 at 16:17
  • Actually, in Stylish you can write a style which applies to ALL sites (even to the browser chrome). You can then set it so that CODE or PRE tags or whatever tags are most commonly used for most fixed-width and set them to whatever font you like.
    – eidylon
    Nov 4, 2009 at 1:34
1

In Google Chrome:

Customise -> Options -> Under the Hood.

Find Change font and language settings, select it and then change the fixed width font from Courier New to the font of your choice.

I can't find an option that says whether this overrides page specified fonts - I suspect it doesn't.

In Firefox:

Tools > Options > Content.

In "Fonts & Colours" select Advanced..., then change the value of the "Monospace" font.

To ignore the fonts as specified on the web page uncheck the "Allow pages to choose their own fonts, instead of my selections above" option on the same dialog.

In IE 8:

Tools > Internet Options > General.

Select Fonts and change the value on the right hand column labelled "Plain text font".

The preamble on this dialog states:

The fonts you select here are displayed on the webpages and documents that do not have a specified tetx font.

So I expect that this will not override any fonts set on the page.

2
  • Will that override a declaration such as .source-code { font-family: Courier, monospace; } ?
    – Patrick
    Oct 24, 2009 at 15:51
  • 1
    @PatricK: no, it just sets the default used for unspecified monospace fonts. you can use user-specified stylesheets to override site CSS-specified fonts: squarefree.com/userstyles/user-style-sheets.html Oct 24, 2009 at 17:40
0

You could use Greasemonkey to insert a style tag to override the Courier font, but this would probably be much too impractical because you would have to do it for every site. I wrote a Greasemonkey script for MSDN that changes Courier to Consolas, if that helps.

You must log in to answer this question.