HTML source should use a monospace (fixed width) font

VERIFIED FIXED in mozilla0.9.1



17 years ago
17 years ago


(Reporter: Håkan Waara, Assigned: Charles Manske)



Firefox Tracking Flags

(Not tracked)



(2 attachments)



17 years ago
The font that is used when editing HTML source isn't the one you expect when
editing code in any form.

Not only is it easier to read the source if it's in a proportional, fixed-width
font (like Monaco, Courier etc.) but it's also a widely (unwritten) used
standard among IDEs.

Currently, it's a pain to use the HTML source editing feature with it's
sans-serif font.

Change it to be the same font as when you're editing plain-text emails in
msgcompose (mailnews).

Comment 1

17 years ago
Assignee: beppe → cmanske
OS: Windows 98 → All
Hardware: PC → All
Summary: HTML source font should be monospace (proportional) → HTML source font should be monospace (proportional) fixed width

Comment 2

17 years ago
Umm, "proportional" is the opposite of "monospace". You are confusing sans-serif
vs serif (e.g., Arial=sans-serif proportional, Times=serif proportional) with
"proportional" vs. "monospace"
I agree that the HTML source should use monospace, which is Courier (and also
Should be easy to fix via CSS.

Target Milestone: --- → mozilla0.9.1

Comment 3

17 years ago
Yeah, sorry about that. Good that you got the point though. :)
Summary: HTML source font should be monospace (proportional) fixed width → HTML source should use a monospace (fixed width) font

Comment 4

17 years ago
I think Lucidia Console is a good font for this on windows.

Comment 5

17 years ago
Wow, a good san-serif monospace font face! Lucida Console is nice, but is that
very common on non-Windows platforms?

Comment 6

17 years ago
The correct question is really: Any other favorite monospace fonts for various
platforms? We can include > 1 in the CSS "font-family" attribute, so we might
as well pick some that work best on each platform.

Comment 7

17 years ago
Monaco got a vote (macos)
LucidaSansTypewriter (?)

Comment 8

17 years ago
Since almost all platforms have Courier pre-installed, I think we should back
the font-faces up with that in case none of the other monospaces are available.

Comment 9

17 years ago
Erm, why don't we just use the default monospace font?

Comment 10

17 years ago
Simon is right; if people really want to use something else they can change
their preference.

Comment 11

17 years ago
Huh? Didn't sfraser just say that we should use the default monospace?

Brade: this shouldn't be a pref, imho, it should be monospace by default.

Comment 12

17 years ago
Of course it will be "monospace", but CSS lets you put > 1 "font-family" in a
row, so I was only asking if there were other platform-specific choices
No pref involved -- this will be part of the theme files anyway, so if someone
really wants something different, they can change the theme CSS.
The default "monospace" seems to be Courier, bty.

Comment 13

17 years ago
Created attachment 32063 [details] [diff] [review]
Use "monospace" font-family in source editor

Comment 14

17 years ago
I decided to keep it simple and just use "monospace" and skip the other
Ready for review.
Keywords: patch, review
Whiteboard: FIX IN HAND need r=, sr=

Comment 15

17 years ago


Comment 16

17 years ago
Changes look fine to me, s/

I'm just curious if the "font-size: larger" looks ok on mac?

Comment 17

17 years ago
I'm curious as well - it doesn't work at all on Windows (nor any other CSS
font size change) I'll file a bug on that.
Whiteboard: FIX IN HAND need r=, sr= → FIX IN HAND

Comment 18

17 years ago
Why does this have changes for mac and windows, but not Unix?  And why does it
have changes in an XP file plus the two platform-specific files?

After applying the patch, I still see variable-width on Unix.

Comment 19

17 years ago
Oh, I see: there is no unix directory there, classic unix uses the windows theme.

I use modern; but if I apply classic, I still see variable-width fonts in the
plaintext editor after applying the patch and remaking in mozilla/themes. 
(Should I have to build anywhere else?)

Comment 20

17 years ago
hmmm. wonder if that's a Linux CSS bug. I've seen "monospace" used in other CSS
files. I'll attach another file so you can test if setting to specific font like
"courier" works. That font exists on Linux, right?

Comment 21

17 years ago
Akkana: You do see monospace with Modern theme? And yes, just build in themes

Comment 22

17 years ago
checked in, but I won't mark fixed until proven to work on all platforms.

Comment 23

17 years ago
Works like a charm on Windows. Thanks for fixing this Charles!
I would suggest using "-moz-fixed" instead of "monospace".  "-moz-fixed" is the 
font chosen by the user in prefs for their fixed-width font....

(sorry for the really late comments; just found this bug).

Comment 25

17 years ago
Thanks, good idea, Boris (Wish I'd known that earlier!)
It doesn't hurt to use this:
    font-family   : -moz-fixed, monospace;
so there's backup, correct?

Comment 26

17 years ago
Created attachment 32629 [details] [diff] [review]
Better fix: defer to user's monospace font set in prefs

Comment 27

17 years ago on the 04/30/01 10:25 patch. on the 4/30 patch.  Using monospace as well is a very good
idea, yes.

Comment 29

17 years ago
I don't think the newest patch should be checked in until we get "monospace" 
working on Mac (why mask a bug?)

Comment 30

17 years ago
'monospace' doesn't work on Mac?? Is there a bug?

Comment 31

17 years ago
very strange; in my Mac build from today, I wasn't getting a monospace font 
earlier but now I am!

Comment 32

17 years ago
Sorry to be the bearer of bad news, but linux still doesn't show a fixed width
font even with the new patch (only tried modern skin).
Akkana, worksforme on Linux with a pull from today and this patch.

What font do you have set as your monospace font in preferences?

Comment 34

17 years ago
checked in. I think any issues left (e.g. on Linux) are different bugs.
Last Resolved: 17 years ago
Keywords: patch, review
Resolution: --- → FIXED
Whiteboard: FIX IN HAND


17 years ago
Blocks: 78441

Comment 35

17 years ago
Still not fixed width on linux in today's builds.

My fixed-width font is currently set at "misc-fixed-iso8859-1" size 14.
Other windows which are supposed to use fixed width font (e.g. plaintext mail)
do so.  It's just plaintext compose that doesn't work.

If you think there's another bug here, please give me a pointer to it.  I'm not
aware of any problems showing fixed-width fonts on linux.
Resolution: FIXED → ---

Comment 36

17 years ago
Somehow I got dropped from the cc, that's why I didn't see when this bug was
marked fixed.

Comment 37

17 years ago
Please see bug 78441. That has the new diff that should make this work.
I know I should have dupped that to this bug, but it has comments that reveal
why Linux has problems.
Last Resolved: 17 years ago17 years ago
Resolution: --- → FIXED

Comment 38

17 years ago
The patch in bug 78441 doesn't fix this bug.  I've commented there.  We can use
that bug to track this issue if you prefer (though if we're going to do that, we
should probably change the summary of that bug since it's very specific and has
nothing to do with the plaintext compose window).

Comment 39

17 years ago
Charley closed 78441 as fixed, but this bug is still open; the font in the
plaintext editor is still variable width.  Reopening.
Resolution: FIXED → ---

Comment 40

17 years ago
But this bug was about HTML Source, not plain text editor. Others have said we
do see monospace in HTML source, do you?
I'm not sure whether or not we should use it in Plain text editor, but it's moot
since that won't be exposed in next release. If you want it, please file separate
I'll file bug about font size issue.

Comment 41

17 years ago
Oops, you're right.  Sorry, I thought this covered the plaintext editor.
Filed bug 79277 about that issue; re-closing this.  The source panel looks fine
to me in today's build.
Last Resolved: 17 years ago17 years ago
Resolution: --- → FIXED

Comment 42

17 years ago
verified in 5/30 build.
You need to log in before you can comment on or make changes to this bug.