본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Plain text files are rendered in proportional font. How can I change this?

more options

When I access plain text files, like `file:///home/username/.profile`, or remote files with mime-type text/plain, they are rendered in Quirks mode. Unfortunately, this has changed to use a proportional-width font on my system, which is rather annoying since it breaks some nice properties for source code.

Using <right-click>-"inspect element" gives a body with one

-element.  Its CSS properties (browser styles) show

    xmp, pre, plaintext {
      display: block;
      font-family: -moz-fixed;
      white-space: pre;
      margin: 1em 0;
    }

Originating from some 'html.css' which I have not found anywhere on my
system.


How can I get plain text being displayed in a monospaced font again?

Thanks!
When I access plain text files, like `file:///home/username/.profile`, or remote files with mime-type text/plain, they are rendered in Quirks mode. Unfortunately, this has changed to use a proportional-width font on my system, which is rather annoying since it breaks some nice properties for source code. Using <right-click>-"inspect element" gives a body with one <pre>-element. Its CSS properties (browser styles) show xmp, pre, plaintext { display: block; font-family: -moz-fixed; white-space: pre; margin: 1em 0; } Originating from some 'html.css' which I have not found anywhere on my system. How can I get plain text being displayed in a monospaced font again? Thanks!

모든 댓글 (6)

more options

I'm not sure what OS and Firefox version you have, so apologies if this doesn't exactly track.

Check the Options (or Preferences) dialog to see what font you have listed for monospaced text.

  • "3-bar" menu button > Options/Preferences > Content

Click the "Advanced" button and check that your Monospace font selection is actually the font you want. Before closing the dialog, check the language selector at the top of the dialog. If you made the change for Western (or another specific character set), change the selector to Other Languages to view fonts used on Unicode pages and update that if needed. (And vice versa...)

Any luck?

more options

Sorry, no.

For your question: Firefox 32.0 on Arch Linux.

I've tried your advice about font settings before, to no avail. And I have played around with these settings a bit more intensively now, with surprising (but unsatisfying) results:

 * With my current setting I do see monospaced font on some web
   pages.  For example the second half of my incorrectly rendered
   question above, or Wikipedia examples on programming languages.
 * Setting Fonts for "Other Languages" has no effect on the rendering
   of the plain text file, but the setting for "Western" has,
   although the Page Info (after hitting C-i) shows
       Type: text/plain
       Render Mode: Quirks mode
       Encoding: UTF-8
   And the file contains german umlauts, rendered as such.  Here [1]
   it is, so you can have a look.
 * In the Fonts dialog (after klicking "Advanced") setting
   "Monospace" has no effect, but setting "Sans-serif" changes the
   font used for the plain text file.  Note, that "Proportional" is
   set to "Sans-serif".
 * If I "Allow pages to choose their own fonts, instead of my
   selection above" in the advanced Fonts dialog, then the plain text
   file is rendered in the font selected for "Monospace".  But I'd
   have to bear all the badly chosen fonts out there on the web...

My conclusion is, that Quirks mode wrongly choses the "Proportional" font setting, instead of the "Monospace" font setting, when Firefox is set not to use websites own fonts. That would be a bug then.

What do you think?

____________________ [1] https://svn.uni-konstanz.de/dbis/inf2_s14/pub/pk2-13.lhs

more options

I cannot reproduce the problem on Firefox 31 on Windows 7 ("Courier New" as monospace font) with any combination of Quirks mode and text/plain (or text/html) and allow pages to choose their own fonts or not choose them. I've got too many tabs going to upgrade this particular system to Firefox 32 right now, but will test again when I can.

Meanwhile, though, I think some Linux users need to take a look.

more options

You could override that with code in userContent.css, either for all websites or for specific websites.

 pre{font-family:monospace!important}

@-moz-document domain(svn.uni-konstanz.de){
 pre{font-family:monospace!important}
}
more options

This does solve the symptom — Thank you!

However, with the findings in my previous post I still suspect a bug. After all, this solution is a rather rugged one, depriving all sites from choosing alternative styles (although I cannot imagine a sensible use case).

Where/how can I file a bug report?

more options