W3C home > Mailing lists > Public > www-style@w3.org > October 2010

Re: about the use of pixels as a unit for typography

From: Peter Moulder <peter.moulder@monash.edu>
Date: Tue, 12 Oct 2010 23:13:03 +1100
To: www-style@w3.org
Message-id: <20101012121303.GA6792@bowman.infotech.monash.edu.au>
On Tue, Oct 12, 2010 at 05:29:44PM +0800, David Singer wrote:
> Don't forget that a CSS pixel might not be a single device pixel.

This is important, but it doesn't help much unless device pixel size is near an
integer fraction of a reference px: otherwise there's still too much difference
between a reference px and an actual px, so still too much variation between
different devices.

When changes to units in CSS were last being discussed, I did wonder whether we
should drop the "whole number of device pixels" recommendation from
syndata.html, such that a px would equal a reference px.  The main reason I
didn't in the end post this suggestion was concern that bitmapped images such
as gifs (especially small ones) would still be with us for a long time.

However, I do have some hope that images will come to be in a more
resolution-independent form to accommodate pinch-based interfaces on
handheld devices.

Should there be a refpx unit (1/2688 of viewing distance) that could be used
at CSS authors' discretion?

In the shorter term, any recommendation of "use pt instead of px" would have to
come with some caveats.  First of all the trivial caveat that I believe Gecko
now treats pt as a fixed ratio of px (i.e. I believe recent builds treat 12pt
as equivalent to 16px regardless of any knowledge it has of display pixel
density).  If you instead had access to a real device pt (or mozmm) unit, then
the problem would instead be that the physical pt size suitable for a desktop
monitor at a "nominal arm's length" away won't be suitable for a handheld
device that's less than half that distance away.

And of course there's still the existing objections to pt/px sizes that the
ideal size for something depends on the person reading it (e.g. how good their
eyesight is) and what their display is (how big, how far away, whether it has
good pixel density).

Using the em unit would sound like a good choice, but I'm told that it too has
problems if many of your audience have an unsuitable default font size and
won't change it.

Unfortunately there is no single ideal-for-all-purposes unit to recommend to

But certainly the variability of pixel densities is one factor for designers
to consider.

Received on Tuesday, 12 October 2010 12:13:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:39 UTC