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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 12 Oct 2010 11:01:31 -0700
Message-ID: <AANLkTin3d+ynADD5cWzkaicbN2yYhJrMEqxopBK56L6s@mail.gmail.com>
To: Peter Moulder <peter.moulder@monash.edu>, www-style@w3.org
On Tue, Oct 12, 2010 at 5:13 AM, Peter Moulder <peter.moulder@monash.edu> wrote:
> 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.

Luckily, this is an area where we can depend on technology to save us.
 We're currently passing through the most painful transition period,
where many screens are midway between 96dpi(1 device pixel = 1px) and
192dpi(2 device pixels = 1px).  Once we cross this threshold and
consumer devices are commonly 192dpi or above, the following
thresholds (288dpi, 382dpi, etc.) aren't nearly so painful.  Once
we're above 300 dpi you can basically forget that there's a such thing
as a device pixel at all - the px will be free to be very close to the
"correct" definition of a px, based on viewing distance and visible

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

Indeed they will be, but more than that, rendering *any* content to
anything other than whole device pixels is a big perf hit.  It would
make painting unacceptably slow.

> 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?

Just give it time, and px will become this.

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

Indeed, the fixed ratio between pt and px is now mandated by the spec.

Received on Tuesday, 12 October 2010 18:02:28 UTC

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