Tiit Lankots
Tiit Lankots

Reputation: 41

Internet Explorer using strange font for <pre>

I hope someone can shed light on this annoying problem I am having with IE - it renders <PRE> tag contents in a "funny" font. See for yourself: https://i.sstatic.net/QdP4q.jpg .

(The screenshot taken from rendering of http://www.roryhart.net/code/xckd-np-complete-restaurant-order/.)

By searching the web and SO, the few relevant answers I've found seem to point to either wrong encoding detected, or to broken fonts (see the strange glyph it is showing instead of "\").

I have played with the encoding also manually, and it doesn't change anything. The font problem I am really not qualified to investigate. What I have found, however, is that somehow an interesting font is indeed chosen for rendering. When going into the Developer Tools in IE and looking at the Trace Styles output of the relevant PRE element, I can see the following:

font-family: "Courier 10 Pitch", Courier, monospace;

I have no clue what "Courier 10 Pitch" could be... But when manually overriding with "Courier New", for example, it starts rendering correctly.

Any ideas? Could it be related to the fact that I have the East Asian Language Pack installed?

Reproduces with all IE versions I have had, 7 to 10. Windows 7 SP1 currently.

Upvotes: 3

Views: 321

Answers (2)

guest
guest

Reputation: 1

You don’t have the “Courier 10 Pitch” font installed on your computer. It’s a Bitstream font, and is IMHO the best Courier font variant apart from Courier Prime (which, unfortunately, is TrueType only). It is a free font, and is available with Ubuntu, for example. You can buy one version at http://www.myfonts.com/fonts/bitstream/courier-10-pitch/, while I would recommend that you extract and use the original (free!) Type 1 version from an Ubuntu installation. Type 1 fonts seem to be supported directly from MS Windows 2000 onwards. It is much, much better than Courier New.

Upvotes: 0

Sam Phippen
Sam Phippen

Reputation: 146

Courier is a type of monospaced font. I assume courier 10 pitch is the default font that Internet Explorer uses for PRE tags, possibly specifically on your version of windows. If you're concerned you should specify the font for the PRE tag to be the same on every browser using CSS.

Upvotes: 1

Related Questions