Last Comment Bug 531299 - Inconsistent Font sizes when windows dpi >96
: Inconsistent Font sizes when windows dpi >96
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: unspecified
: x86_64 Windows 7
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Milan Sreckovic [:milan]
: 491718 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2009-11-26 10:42 PST by Danial Horton
Modified: 2011-05-05 23:11 PDT (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Firefox @ 100%, windows 96 dpi (237.62 KB, image/jpeg)
2009-11-26 10:44 PST, Danial Horton
no flags Details
Firefox @ 100%, windows 120 dpi (285.85 KB, image/jpeg)
2009-11-26 10:45 PST, Danial Horton
no flags Details
IE @ 100%, windows 96 dpi (285.04 KB, image/jpeg)
2009-11-26 10:45 PST, Danial Horton
no flags Details
IE @ 100%, windows 120 dpi (279.94 KB, image/jpeg)
2009-11-26 10:46 PST, Danial Horton
no flags Details

Description Danial Horton 2009-11-26 10:42:56 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.3a1pre) Gecko/20091125 Minefield/3.7a1pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.3a1pre) Gecko/20091125 Minefield/3.7a1pre

At the same level of Zoom, certain text in webpages is larger than it should be when the windows dpi is >96.

It appears to be inconsistent usage of DPI scaling,  The scaling on the UI is fine however.

Reproducible: Always

Steps to Reproduce:
1. Set windows DPI to 120
2. Open a forum such as
3. Compare the text for topic names (and topic name links) and quotes between Firefox and IE.

(installation of Default FullZoom will help set the proper 125% for comparison)
Actual Results:  
Certain area's of text are different sizes even using the same font size, when the windows dpi is above 96.

Expected Results:  
The font sizes are consistent between Firefox and IE at the same font size / font type and style

I believe this issue stems from partial application of the windows dpi setting to the contents of the webpage.  For all intents Firefox should just apply a default zoom level equivalent of the Windows DPI Percentage, rather then attempting to do its funky DPI calculation, as at default DPI the zoom settings and text sizes are 1:1 between Firefox and IE.
Comment 1 Danial Horton 2009-11-26 10:44:35 PST
Created attachment 414751 [details]
Firefox @ 100%, windows 96 dpi
Comment 2 Danial Horton 2009-11-26 10:45:22 PST
Created attachment 414752 [details]
Firefox @ 100%, windows 120 dpi
Comment 3 Danial Horton 2009-11-26 10:45:47 PST
Created attachment 414753 [details]
IE @ 100%, windows 96 dpi
Comment 4 Danial Horton 2009-11-26 10:46:11 PST
Created attachment 414754 [details]
IE @ 100%, windows 120 dpi
Comment 5 Tim (fmdeveloper) 2009-11-27 01:22:13 PST
Take a look at Bug 433664. This looks to be a duplicate of that bug.
Comment 6 Danial Horton 2009-11-27 01:42:23 PST
possibly, though mine differs from his in several ways.

For starters i realise the difference between IE and Firefox's text size actually lays in the fact that the IE text is not scaled to DPI, rather IE matches the Page zoom to the current DPI %

The problem im having is that when both are set to the same Zoom amount, then certain area's of text appear to have the DPI scaling applied as well as the zoom so they appear larger than they should.  Such as my screenshots demonstrates.
Comment 7 Tim (fmdeveloper) 2009-12-07 21:39:42 PST
I think that duping to 433664 is the right call. Take a look at Bug 433664 comment 18 if you want FF to act more like IE w/ DPI.

*** This bug has been marked as a duplicate of bug 433664 ***
Comment 8 Danial Horton 2009-12-07 22:42:47 PST
Disagreed, it is not a duplicate, i do not want the dpi to scale the text in the webpage AT ALL. get it through your skull.

Text scaling in webpages should not be effected by the dpi at all, only the GUI.  Text scaling in IE is done via the zoom function and the same should go for Firefox.
Comment 9 Danial Horton 2009-12-07 22:50:43 PST
The modification in the comment specified effects the GUI. The GUI is not the problem here.  Its certain area's of text in the webpage itself.  The screenshots should be more then enough of an example.

DPI effects certain area's of text in firefox's page area,
Where as it does not effect IE in the same way.

Its CLEARLY a different issue.

Regardless of the usage of those settings,  You just end up making the GUI smaller, and both the correct and incorrect areas of text smaller.  Regardless the comparison is still incorrect and the size is not consistent in the same webpage between IE and Firefox.
Comment 10 Danial Horton 2009-12-07 22:56:55 PST
The Text in the quote area should be the same size as the text outside it, the only time the size should differ is when a size tag is used to increase or decrease it.  Granted the size can be made smaller with size tags however this then makes them different in IE, and firefox when at the default DPI.

It is entirely an issue in which firefox is applying the system DPI to certain area's of text in a webpage.

Let me make this clear.
the DPI does not effect the Page Text size in IE directly, it manages the difference by applying a level of zoom equal to the current DPI % to the page viewing area.
The DPI DOES effect the page text size in Firefox Directly, but only for certain area's of text. Some area's of text are consistent between IE and Firefox while others have Firefox render them differently.  This is the inconsistent behavior.  The only thing that effects page text size should be the Font options in Firefox's options (which they do, i can increase the min  text size but this breaks other pages), and the Zoom control.  DPI should be entirely limited to the scaling of the GUI. it should not effect the webpage outside of default setting the Zoom to match, or near the same zoom % of the system DPI.
Comment 11 Sylvain Pasche 2009-12-08 01:36:16 PST
That's because Gecko uses by default the system dpi value for computing the size of elements that are sized using an absolute length unit. That's the case of the quote section on that forum page which uses a font size of 10pt.

IIRC, IE and WebKit hardcode 96dpi when computing the size of absolute length units ('pt', 'in', 'cm', etc.) but Gecko and Opera use the system dpi value.

If you want to match IE behavior, you could set layout.css.dpi to 96 in about:config.
Comment 12 Danial Horton 2009-12-08 01:53:03 PST
Ok that makes sense, and that config actually works, so thanks (comment 18 didn't).

actually, im surprised that setting actually works,  i've read forum posts where it was linux or mac only.

That said,  wouldn't it be better to expose a drop down DPI menu in the fonts options, with settings such as

Use System Default


To be assured, the first thing a person on a high dpi screen will notice is the differences in fonts,  when moving between Firefox and IE, and there is inconsistent information on the internet to explain why.

Was this setting changed to apply on windows as only recently? because the page describing the setting was formely indicating it is ignored on windows, however it does not anymore.
Comment 13 Sylvain Pasche 2009-12-08 02:26:27 PST
I think this behavior is be the same between all platforms, and I guess it works that way since at least Firefox 3.5, but I didn't check to make sure. Where did you see documentation about this feature? If it's part of the official documentation (i.e. somewhere on the domain) it should probably be fixed.

The problem I see with a "select your DPI" UI is that the average user wouldn't understand what this is about and how it would affect web pages.

I agree that the current situation with high DPI is less than optimal on Firefox. If you set your system to 120 DPI on Windows for instance, you usually expect everything to be larger in the same proportions but that's not what happens.
Comment 14 Danial Horton 2009-12-08 03:14:24 PST
Microsoft was actually addressing that issue,

Though anyone who has found their way into the DPI screen on windows, would have to have atleast googled what it does.

One of the places i found when looking for help on the dpi issue was this thread/discussion

It seems some people still don't know it now works on windows?
Comment 15 Wayne Mery (:wsmwk, NI for questions) 2010-03-12 02:26:39 PST
So the upshot is this is working as designed?

(In reply to comment #13)
> The problem I see with a "select your DPI" UI is that the average user wouldn't
> understand what this is about and how it would affect web pages.

perhaps there are other things which might be appropriate on a preferences "accessibility tab"?
Comment 16 RNicoletto 2010-05-11 07:40:09 PDT
*** Bug 491718 has been marked as a duplicate of this bug. ***
Comment 17 Felix Miata 2011-05-05 23:11:32 PDT
Since bug 537890 landed 16px always equals 12pt, which means desktop DPI no longer impacts the so-called "absolute units" pt, pc, in, mm & cm. The only unit left that is supposed to be affected by DPI is mozmm, which is not supported by other browsers.

The forum mixes pt and px text sizing. With the old behavior, differences between IE and Gecko at other than 96 DPI from that poor type of page styling were to be expected. -> INVALID

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