Open Bug 328621 Opened 18 years ago Updated 2 years ago

strange default `monospace' font size -- differs from the proprtional fonts

Categories

(Core :: Layout: Text and Fonts, defect)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: JITR, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050319
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 SeaMonkey/1.0

I think the default font size for the `monospace' font family setting is strange. It differs from the size of proportional fonts (see the `Preferences' dialog in `Appearance/Fonts' -- the Size dropdown list `Value' is different for the lines `Proportional' and `Monospace'. For the latin locales (ie. when e. g. `Western' or `Central European' is selected in the `Fonts for' dropdown), the values are 16 pixels for `Proportional' but 13 pixels for `Monospace'.


Reproducible: Always

Steps to Reproduce:
1. Copy and paste the following code into a file and open it in the browser (will also attempt to post the code as an attachment):

   <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">

   <html>
      <head>
      </head>

      <body>
         <div><span style="font-family: monospace;">Xx</span><!--
            --><span style="font-size: 16px; font-family: monospace;">Xx</span></div>
         <div><span style="font-family: sans-serif;">Xx</span><!--
            --><span style="font-size: 16px; font-family: sans-serif;">Xx</span></div>
         <div><span style="font-family: serif;">Xx</span><!--
            --><span style="font-size: 16px; font-family: serif;">Xx</span></div>
      </body>

2. Each line presents the string `Xx' in one of the 3 font families: `monospace', `sans-serif' and `serif', respectively. The first `Xx' is rendered using the currently set default size for the given family, whereas the second `Xx' uses explicitly set with of 16 pixels. With the above mentioned defaults, there should be slight size difference on the first line.

3. Change the size for monospaced font to 16 pixels (so it matches the default setting for proportional font size). Both `Xx'es on the first line should now look the same.

Actual Results:  
As per the step 2. in the `Steps to Reproduce' section.


Expected Results:  
As per the step 3. in the `Steps to Reproduce' section with the default out-of-box settings (ie. without making the settings changes described in the step 3.).


This makes Mozilla-based browsers differ form M$ Internet Explorer. While I don't want to say IE should be considered the best way to go, we should not differ in this regard, because this makes writing HTML more complicated when one wants them to look similar in several browsers (unless we fall back to specifying absolute sizes). In fact this also makes monospaced text look smaller than the rest.

There have been several bugs issued regarding to the font sizes. However I couldn't find any that would refer specifically to the difference between monospaced and proportional fonts. This difference has been around for quite a long time (more than a year). Confirmed on Mozilla ver. 1.7.6, SeaMonkey ver. 1.0 and Firefox ver. 1.0.2. As I could examine the setting of preferences `font.size.fixed.*' in `all.js' of the Linux tar.gz version, the same problem should exist there, too, though the defaults differ (12 pixels instead 13 if I recall correctly). So set OS and platform to All.

Well, I think this might end up a WONTFIX, but I at least hope someone will give some rationale/explanation on why the defaults are set this (for me strange) way.

Though the inter-browser portability problem this imposes doesn't seem that trivial to me. The last time I wanted to markup HTML so that the monospaced parts showed the same in both Mozilla and M$IE I had to resort to absolute font sizes, which should be certainly avoided due to the accessibility problems they impose.

And yes, there's a simple workaround -- changing the settings. But most of the users will use defaults. :-(
(In reply to comment #0)

Addition to the step 3.:

> 3. Change the size for monospaced font to 16 pixels (so it matches the default
> setting for proportional font size). Both `Xx'es on the first line should now
> look the same.

I forgot to point out that the `Fonts for' dropdown box must be set to the correct charset that is being used when displaying the test code (it should be the one you have set as a default).
Related to bug 51984 comment 15 and item 12. of Firefox bug 258751?
Component: General → Layout: Fonts and Text
Product: Mozilla Application Suite → Core
Version: unspecified → Trunk
zug_treno, yes, you're right. Item 12 of bug 258751 suggests the same. And bug 51984 comment 15 explains where this comes from -- ie. it tries to maintain compatibility with the olden Netscape. On the other hand this bug says the default sizes are too large which is a different thing. Item 12 of the mentioned bug 258751 is identical to what I'm trying to say. Maybe we can mark something as a dupe?

In any case, it still seems using absolute font sizes when writing web pages will be the most portable way for some more time...
Assignee: general → nobody
QA Contact: general → layout.fonts-and-text
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: