Bug 522950 - Odd monospace font-size inconsistency on Planet Fedora
Summary: Odd monospace font-size inconsistency on Planet Fedora
Alias: None
Product: Fedora
Classification: Fedora
Component: firefox
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Gecko Maintainer
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2009-09-12 15:39 UTC by Jud Craft
Modified: 2018-04-11 07:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-09-21 13:35:29 UTC

Attachments (Terms of Use)
firefox shot of monospace (planet fedora) - Fedora (135.74 KB, image/jpeg)
2009-09-12 15:43 UTC, Jud Craft
no flags Details
firefox shot of monospace (planet fedora) - Mac (140.03 KB, image/jpeg)
2009-09-12 15:45 UTC, Jud Craft
no flags Details
monospace-article-large-planetubuntu (109.41 KB, image/png)
2009-09-15 01:52 UTC, Jud Craft
no flags Details
monospace-article-correct-source (118.52 KB, image/png)
2009-09-15 01:54 UTC, Jud Craft
no flags Details

Description Jud Craft 2009-09-12 15:39:55 UTC
Description of problem:
Firefox on Fedora displays inconsistently displays unusually large monospace fonts, particularly on Planet Fedora.

Version-Release number of selected component (if applicable):
Firefox 3.5.2, but all previous releases as well since Fedora 8 at least (when I started using Fedora).

How reproducible:

Steps to Reproduce:
1.  Visit planet fedora.
2.  Scroll down to someone who posts code or scripts in a monospace font.
3.  Observe the change in font size.
Actual results:
Some articles have font sizes that match Firefox's settings, while some do not.  These inconsistencies do not happen on other platforms (see attached Mac screenshot of Firefox.)

Expected results:
Monospace fonts should be displayed uniformly -- and consistently on Firefox across platforms.

Additional info:
Not sure if this is a specific problem with Linux firefox.

Comment 1 Jud Craft 2009-09-12 15:41:56 UTC
For reference, I have the default Firefox font settings (16, mono-13, minimum-none), 98dpi in GNOME, no xorg.conf.  The Mac, at least for Firefox, has the same settings (16, mono-13, minimum-none).

I had assumed that Firefox actually ignores DPI and always displays at 72dpi (since changing the GNOME and XRDB dpi never seems to affect firefox rendering).

Comment 2 Jud Craft 2009-09-12 15:43:45 UTC
Created attachment 360789 [details]
firefox shot of monospace (planet fedora) - Fedora

Notice that monospace in the body text is the correct size, while monospace in the separate paragraphs (not sure if Planet Fedora uses /pre or /code tags) is huge.

Comment 3 Jud Craft 2009-09-12 15:45:06 UTC
Created attachment 360790 [details]
firefox shot of monospace (planet fedora) - Mac

Shot of same site in Mac Firefox 3.5.3.  Note that the monospace text is uniformly sized throughout the body of the article.

Comment 4 Yanko Kaneti 2009-09-12 16:04:16 UTC
This looks like a duplicate of bug 508899 , which is a liberation-fonts issue. Try a different font for the firefox monospace font setting to confirm.

Comment 5 Jud Craft 2009-09-12 16:46:38 UTC
I...already am.  My monospace font is "monospace", which I believe defaults to Deja Vu Sans on Fedora systems via fontconfig.

Switching it formally to "Deja Vu Sans" has no effect.  In addition, I decided to set the Sans & Serif to Arial and Times New Roman, since I originally used Liberation, but this has no effect either.

Just to be sure I unchecked "Let Pages Use Their Own Fonts", thus forcing my fonts.  This had no effect and the monospace fonts are still displayed incorrectly on Planet Fedora.

To be certain, I then tried a completely different font (Consolas), and got the same effect (some monospace blocks on p.f.o are displayed at a huge size, while some are not).

This is definitely a font size issue, not a font-face issue.

In addition, I later separately tried changing my DPI to 72.  This did not work; fonts were displayed EXACTLY the same in Firefox as at DPI-98 (although of course GNOME UI was -much- smaller).

Comment 6 Jud Craft 2009-09-12 16:47:41 UTC
Also, don't you see the same thing when you visit Planet Fedora and scroll down to some code or script text?  This has always happened to me on every version of Fedora & Firefox.  I don't think I "did" something to make this happen.

Comment 7 Yanko Kaneti 2009-09-12 18:04:25 UTC
I think I misread the bugreport and jumped the gun here. I see now its a size, not spacing issue, duh. Sorry for the noise.

Comment 8 Jud Craft 2009-09-15 01:52:08 UTC
Created attachment 361024 [details]

Again, observe the HUGENESS of the monospace font.  "pre" tags here.

Comment 9 Jud Craft 2009-09-15 01:54:03 UTC
Created attachment 361025 [details]

The same article, from its own website.  The "pre" tags are still used, but the font isn't so huge!

Same with Planet Fedora.  Lennart Poettering's recent article on mutexes:  it uses "pre" tags on both Planet Fedora and the original page.

But PF has a -huge- font size for the monospace parts, while it appears the correct size in Lennart's blog.

Why does this occur on the Planet sites?  Is there a div/css/styles inheritance problem going on?

Comment 10 Jud Craft 2009-09-15 03:25:38 UTC
It turns out, the problem is rather convoluted...

It has to do with the CSS in fedoraproject.org/static/css/fedora.css.

In particular, for the "pre" tag:

font-size:  2.6ex;

The "ex" unit is what causes the large size of the font; ex is an unusual CSS unit type.

This unit type seems to be ignored on Firefox 3.5 for Mac.

Comment 11 Jud Craft 2009-09-15 03:36:24 UTC
One possible solution is to put the following line in your userContent.css in ~/.firefox/profiles/[profile]/chrome/...


pre { font-size: 1em ! important; }


This will disregard special "pre" tag sizing, and display the fonts at their normal size for that block.  (IE, if they are wrapped in a "font-size: 75%" block, then the final font will be 75% of 1em.  It doesn't set an absolute font-size, but it allows you avoid any "ex" units that are associated with the "pre" tag).

This seems to clear up giant font monospace sizes in many cases.

Comment 12 Matěj Cepl 2009-09-21 13:35:29 UTC
Feel free to discuss this further, but in my opinion there is nothing Firefox should do better. Closing as NOTABUG

Comment 13 Jud Craft 2009-09-22 00:40:56 UTC
No, I suppose not.

Note You need to log in before you can comment on or make changes to this bug.