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

Bug #201487 reported by Alexander Jones on 2008-03-12
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
firefox (Ubuntu)
ubufox (Ubuntu)

Bug Description

Binary package hint: firefox-3.0

I noticed that the text on my homepage was larger than it used to be:

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

Alexander Jones (alex-weej) wrote :
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 is the root cause. Or?

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

Changed in firefox-3.0:
status: New → Confirmed
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

Markus Golser (golserma) wrote :

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

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.

RonSmits (ron-smits) wrote :

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

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

Alexander Sack (asac) wrote :

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

Changed in firefox-3.0:
importance: Undecided → Low
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
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.

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

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

Alexander Jones (alex-weej) wrote :

Please stop DUPing this incorrectly.

Alexander Sack (asac) wrote :

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

Changed in ubufox:
status: New → Invalid
Alexander Sack (asac) wrote :

should be properly linked upstream.

Changed in firefox-3.0:
status: Confirmed → Triaged

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

User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv: 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).

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

Please ignore comment 1.

What are you using to measure the DPI?

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

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

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

The difference in what?

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

I mean the difference between 191 and 96 dpi.

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

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".

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

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

Luke Schlather (luke2760) wrote :

I found this bug in Firefox:

Should we link that up as assigned?

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

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:
which works much better.
The six screenshots in the screenshots.tar attached to the
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)
rubo77 (rubo77) wrote :


Solution there:

in about:config search for
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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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