Firefox uses the wrong DPI; should use the GNOME desktop setting in GConf

Bug #201487 reported by Alexander Jones
68
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
New
Unknown
firefox (Ubuntu)
Triaged
Low
Unassigned
ubufox (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: firefox-3.0

I noticed that the text on my homepage was larger than it used to be: http://alex.weej.com/

After double-checking my source code (and finding that the font should be 10pt high), I checked to see what would happen if I set the DPI manually to that of my screen. In about:config I changed layout.css.dpi from -1 (automatic?) to 96, and this caused the text to be drawn at the right size.

Firefox is apparently checking the DPI settings for my screen automatically. xdpyinfo reports my screen as being:

screen #0:
  dimensions: 1280x1024 pixels (300x230 millimeters)
  resolution: 108x113 dots per inch

Which is a bug in X also introduced this cycle.

Firefox should use the GNOME DPI setting when its own DPI setting is "automatic" (-1). This value currently resides in GConf under /desktop/gnome/font_rendering/dpi.

This also affects Epiphany, which is how I found the problem in the first place.

ProblemType: Bug
Architecture: i386
Date: Wed Mar 12 17:15:33 2008
DistroRelease: Ubuntu 8.04
Package: firefox 3.0~b3+nobinonly-0ubuntu4
PackageArchitecture: all
SourcePackage: firefox-3.0
Uname: Linux 2.6.24-11-386 i686

Revision history for this message
Alexander Jones (alex-weej) wrote :
Revision history for this message
Morten Siebuhr (msiebuhr) wrote :

I can confirm that setting about:config -> 'layou.css.dpi' to 96 solved my font-rendering problems in FF (and persist in all other Gecko-rendering applications I have installed).

xdpyinfo gives me:
screen #0:
  dimensions: 1680x1050 pixels (300x230 millimeters)
  resolution: 142x116 dots per inch

For the sake of completeness, I assume https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/201032 is the root cause. Or?

(And thanks for the workaround, Alexander -- hero of the day!)

Changed in firefox-3.0:
status: New → Confirmed
Revision history for this message
sibidiba (sibidiba) wrote :

I can confirm this bug. After upgrading to Firefox beta 4, _huge_ fonts appeared in the browser.

My display has 98 DPI, xdpyinfo returns:

screen #0:
  dimensions: 1680x1850 pixels (204x225 millimeters)
  resolution: 209x209 dots per inch

Revision history for this message
Markus Golser (golserma) wrote :

Same problem here at:
screen #0:
  dimensions: 1920x1200 pixels (372x231 millimeters)
  resolution: 131x132 dots per inch

Revision history for this message
Finlay Thompson (finlay-nz) wrote :

I had the same problem.

I noticed it with websites that defined fonts in points (including this one).

Changing the 'layout.css.dpi' to 96 fixed the problem.

Revision history for this message
RonSmits (ron-smits) wrote :

Problem confirmed here too, changing the layout.css.dpi fixed it for me too

xdpyinfo:
screen #0:
  dimensions: 1440x900 pixels (212x159 millimeters)
  resolution: 173x144 dots per inch

Revision history for this message
Alexander Sack (asac) wrote :

isn't that setting avalable as some x property? (instead of gconf)?

Changed in firefox-3.0:
importance: Undecided → Low
Revision history for this message
Alexander Sack (asac) wrote :

actually a whishlist bug to use font dpi setting instead of screen dpi.

Changed in firefox-3.0:
importance: Low → Wishlist
Revision history for this message
John Vivirito (gnomefreak) wrote :

Alexander it is in gconf. but i wasnt able to set it there and it affect firefox-3.0 during testing for gutsy. This might have changed since than but there is a DPI setting in fonts menu in gconf.

Revision history for this message
cecil_t (greg-hasslers) wrote :

Same issue here, Firefox fonts appear very large on certain sites and sometimes only on certain sections of a site, while others appear normal. Changing about:config setting layout.css.dpi to 96 appears to correct the problem.

If this is of any use:
$ xdpyinfo
screen #0:
  dimensions: 1680x1050 pixels (331x201 millimeters)
  resolution: 129x133 dots per inch

Revision history for this message
Tom Bott (tombott) wrote :

Save problem here, and setting layout.css.dpi to 96 has resolved for me too.

screen #0:
  dimensions: 1920x1200 pixels (332x210 millimeters)
  resolution: 147x145 dots per inch

Revision history for this message
Alexander Jones (alex-weej) wrote :

Please stop DUPing this incorrectly.

Revision history for this message
Alexander Sack (asac) wrote :

nothing here that ubufox can really do. the real fix should go to firefox.

Changed in ubufox:
status: New → Invalid
Revision history for this message
Alexander Sack (asac) wrote :

should be properly linked upstream.

Changed in firefox-3.0:
status: Confirmed → Triaged
Revision history for this message
Alexander Jones (alex-weej) wrote : Re: [Bug 201487] Re: Firefox uses the wrong DPI; should use the GNOME desktop setting in GConf

asac: is it not possible for an extension to set config options on startup?

Revision history for this message
In , Dan-500 (dan-500) wrote :

User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6 Ubiquity/0.1.4
Build Identifier:

Firefox does not use the same dpi as GTK in some cases.

Reproducible: Always

Steps to Reproduce:
1. Change dpi to 191 in GTK.
2. Start firefox
Actual Results:
Firefox itself is using 96 dpi and GTK 191 dpi, so it looks awful.

Expected Results:
Result has to be similar to 192 dpi result.

layout.css.dpi is set to -1 (default).

Revision history for this message
In , Tyler Downer (tyler-downer) wrote :

What version of Firefox are you using, and can you please give a screenshot or some example of the issue in Safe Mode?

Revision history for this message
In , L. David Baron (dbaron) wrote :

Please ignore comment 1.

What are you using to measure the DPI?

Revision history for this message
In , L. David Baron (dbaron) wrote :

(And do you see the same issue in a build from mozilla.com rather than the Ubuntu build?)

Revision history for this message
In , Dan-500 (dan-500) wrote :

Yes, i see the same issue in "firefox-3.0.6.tar.bz2". I also see the same issue in Shiretoko 3.1b2pre 20090122.

Revision history for this message
In , Dan-500 (dan-500) wrote :

> What are you using to measure the DPI?
You don't need to use a tool, because the difference is very big.

Revision history for this message
In , L. David Baron (dbaron) wrote :

The difference in what?

Revision history for this message
In , Dan-500 (dan-500) wrote :

Er, I'm using gnome-appearance-properties to set the dpi.

Revision history for this message
In , Dan-500 (dan-500) wrote :

I mean the difference between 191 and 96 dpi.

Revision history for this message
In , L. David Baron (dbaron) wrote :

What is different? Why does it "look awful"?

Revision history for this message
In , L. David Baron (dbaron) wrote :

For what it's worth, when the DPI goes from 191dpi to 192dpi, the expected result is that we change our CSS pixel scaling factor from 1 to 2, so that a CSS pixel becomes 2 device pixels instead of one. This may be relevant because our default font size is 16 CSS pixels, and images by default are given a size based on their intrinsic dimensions, in CSS pixels. I'm guessing that's what you're complaining about, but you haven't actually said anything about the symptoms you're seeing other than "looks awful".

Revision history for this message
In , Dan-500 (dan-500) wrote :

Yes, that's it. Sorry for my bad description.

Revision history for this message
In , Dan-500 (dan-500) wrote :

So why there's no scaling factor between 1 and 2? The zoom feature has no problems with these factors.

Revision history for this message
In , Dan-500 (dan-500) wrote :
Revision history for this message
Luke Schlather (luke2760) wrote :

I found this bug in Firefox:
https://bugzilla.mozilla.org/show_bug.cgi?id=478746

Should we link that up as assigned?

Revision history for this message
In , Luke Schlather (luke2760) wrote :
Revision history for this message
John Vivirito (gnomefreak) wrote :

This should be enough to follow bug

Changed in firefox:
importance: Undecided → Unknown
status: New → Unknown
affects: firefox-3.0 (Ubuntu) → firefox-3.5 (Ubuntu)
Changed in firefox-3.5 (Ubuntu):
importance: Wishlist → Low
Changed in firefox:
status: Unknown → New
Changed in firefox:
importance: Unknown → Medium
Revision history for this message
In , Peter Funk (pf-artcom-gmbh) wrote :

I've a Laptop with 137 dpi resolution. The way to small fonts
have bothered me a long time. Usually I used a minimum font size of 22
to work around this without understanding the details.
Today I installed the following Addon as a workaround:
https://addons.mozilla.org/en-US/firefox/addon/2592/
which works much better.
The six screenshots in the screenshots.tar attached to the https://bugzilla.redhat.com/show_bug.cgi?id=478312
illustrate the buggy discrete jumping scaling behaviour quite good.
The buggy behaviour can also be observed on Windows (tested this today
with a fresh download on Windows XP running in a virtual box).
This should really be fixed in future releases of Firefox.

affects: firefox-3.5 (Ubuntu) → firefox (Ubuntu)
Revision history for this message
rubo77 (rubo77) wrote :

related: https://bugs.launchpad.net/ubuntu/+source/unity-webapps/+bug/1333158

Solution there:

in about:config search for
layout.css.devPixelsPerPx
and set this value to the same scale factor as in unity-control-center

Changed in firefox:
status: New → Unknown
Changed in firefox:
status: Unknown → New
Changed in firefox:
importance: Medium → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.