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

RE: Making pt a non-physical unit

From: Linss, Peter <peter.linss@hp.com>
Date: Tue, 12 Jan 2010 18:15:16 +0000
To: www-style W3C Group <www-style@w3.org>
Message-ID: <A56057A4896BEC4BA13EE4C45CEB4FED2B85DAD028@GVW0538EXC.americas.hpqcorp.net>
I am also opposed to introducing the "true" units.

First of all, display zoom is a UA artifact and if used, _everything_ should scale uniformly (I have no issue with re-rendering text at the higher resolution using better font data, images too for that matter). CSS should be silent on the issue of display zoom and not have any units that behave specially due to zoom.

Second, having "true" units does no one any good when the ratio from device pixels to real world physical units isn't reliably known. If it's known, then there's no reason why regular units can't be "true" units.

Third, allowing authors to mix logical physical units and true physical units will led to nothing other than chaos, confusion and broken web pages.

If authors really need to be using "true" units, then there should be a media query to test for whether units are physical or logical.

I do accept print media use cases where units scale, like your poster or billboard example, I consider this a case of display zoom.

I do see a use case for a device pixel unit, but it still scares me as it's ripe for abuse and will likely be misunderstood. The best use case I can come up with for it is a hairline border, where I want it to be the thinnest possible line that the output device can render. If there's really a compelling need for that, I think I'd rather have a "hairline" unit than device pixel.

Peter

-----Original Message-----
From: Giuseppe Bilotta [mailto:giuseppe.bilotta@gmail.com] 
Sent: Tuesday, January 12, 2010 12:24 AM
To: Linss, Peter
Cc: www-style W3C Group
Subject: Re: Making pt a non-physical unit

On Tue, Jan 12, 2010 at 12:04 AM, Linss, Peter <peter.linss@hp.com> wrote:
> I will vigorously oppose any change that makes points anything other than 1/72 of an inch (unless we really want to get pedantic and correct it to the Truchet definition from the 1600s of 15625/833118mm, ok, not really).
>
> I accept that the px unit was doomed from the start and I'm OK with having px defined to be 1/96th of an inch just to provide some sanity for the installed base. This will by definition set the ratio between px and all other physical units as we're not going to allow well established ratios of units to change.
>
> Now, how CSS units map to real-world physical units is something that simply has to be handled on a per-media, per-device basis by the UA. For interoperability sake, it makes sense to have a defined algorithm to use when 1:1 physical mapping is unavailable (or unwise). For certain media, like print, there's no good reason that it should be anything other than 1:1. For screen devices, if the environment has a reliable mechanism that allows the UA to determine how many device pixels map to real world units, then sure, go for it, otherwise use the algorithm. (For the record, I don't consider Windows to be in this category, I'm thinking at this point this may be limited to devices like e-readers.)

Note that for some extreme cases of print media it might make sense to
have a non-1:1 relation between logical and physical. A poster or ad,
for example, might be created from a standard CSS by having 1
'logical' inch correspond to a 1ft or whatever. More about this later.

The proposal to consider the difference between logical and physical
units could be standardized in CSS by rewriting and expanding the
discussion about the "reference pixel".

The ratio between logical and true physical units would be influenced
by factors such as monitor resolution, assumed viewing distance, zoom
level, etc. Lacking information, these would be assumed to be at a 1:1
ratio (at the default zoom level), using whatever reference is
available from the (visual) media: screen pixel for monitor display,
printer metrics for print media, etc.

The current CSS absolute lengths would keep their description, with
the additional specification that they are _logical_ units of length.
Additionally, px would be made into a logical absolute length too,
equal to 1/96in. The rewritten discussion about the reference pixel
would be de facto equivalent to what the current standard commands.

Additionally, CSS could introduce the proposed true physical units
(truept, truein, truecm, etc) which ought to be rendered, to the best
of the UA knowledge, as the actual given lengths measured _on the
physical object_. (Thus, a poster-specific CSS could use true physical
units and express lengths in feet, etc). An important point about
these units is that they would NOT be influenced by zoom levels.

Of course, the "to the best of the UA knowledge" means that, lacking
other information, a 1:1 ratio ought to be assumed when no knowledge
is given, a fallback that could be used also when 'true physical'
"doesn't make sense" (glasses, for example). A recommendation of the
CSS spec could be to only use 'true physical' units where they (1)
make sense _and_ (2) are absolutely necessary.

The question at this point would be whether a 'truepx' should be
introduced as well, and whether it should be equal to 1/96truein or
rather the smallest representable physical unit on the device (single
screen pixel, single printer dot, etc).

How does this proposal sound?

-- 
Giuseppe "Oblomov" Bilotta
Received on Tuesday, 12 January 2010 18:16:25 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:23 GMT