Layout.css.dpi: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
(→‎Has an effect in: verified for TB 2.0.0.6 Linux/i686 release)
Line 25: Line 25:
==Has an effect in==
==Has an effect in==
* Firefox (all versions since 2.0)
* Firefox (all versions since 2.0)
* Thunderbird (all versions since 2.0)
* SeaMonkey (Trunk and branch builds after 2006-02-28)
* SeaMonkey (Trunk and branch builds after 2006-02-28)



Revision as of 23:13, 20 August 2007

Background

CSS can use a variety of units for specifying dimensions. These units are classified as either absolute or relative. Absolute units (inches, centimeters, millimeters, points, and picas) are intended for use when the final output medium is of known dimensions; for example, in a print stylesheet. When they are used onscreen, their actual values must be calculated based on the DPI of the screen.

This preference determines what DPI should be used for calculating the dimensions of elements set using absolute width units. Some examples: At 96dpi, a 12-point font is displayed with 16 pixels in size (calculated as 12/72 = 16/96); conversely, an 18px font is printed as 13.5pt (18/96 = 13.5/72, regardless of the actual printer resolution).

Previously known as browser.screen_resolution (in Firefox 1.0.x) and browser.display.screen_resolution (in Firefox 1.5.0.x).

Possible values and their effects

-1

Use the host system’s logical resolution or 96, whichever is greater, for interpreting dimensions specified in absolute units. (Default)

0

Use the host system’s logical resolution for interpreting dimensions specified in absolute units.

(any positive integer)

Use this number for interpreting dimensions specified in absolute units.

Caveats

  • This preference is not meant as a general “zoom” feature to scale all rendered web content.
  • This preference has no effect in Windows (the OS’s DPI setting is queried directly).

First checked in

2006-02-28 by L. David Baron

Has an effect in

  • Firefox (all versions since 2.0)
  • Thunderbird (all versions since 2.0)
  • SeaMonkey (Trunk and branch builds after 2006-02-28)

Related bugs

Related preferences

External links