Re: Making pt a non-physical unit

On Thu, Jan 21, 2010 at 3:33 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> I guess if nobody but me wants it to be a general property, then maybe an @rule would be better?

I would agree with a general property for scaling, BTW. I wouldn't
call it zoom, though.

> I think writing 'reference-length: 1px = 1px' is more confusing than 'zoom:1'. Which side is the CSS px and which side is the device pixel?

The left one would be CSS and the right would be real. These are just
conventions. I could ask the same about margin-width: 1px 2px 3px 4px
it's not obviously which one is top, which one is left, which one is
right and which one is bottom. It's just a convention. If we want to
make it more readable, we could have reference-length: 1 px = 1 truepx
(where the trueXX units would only exist in this context).

> It seems to do the same as 'zoom:1', but you are also assuming it would only be set on BODY or :root?

reference-length: 1px 1px would be more informative than zoom: 1.
Compare with reference-length: 1in 1in.

Both 1px 1px and 1in 1in are 'zoom 1', in a sense, but the rendering
may vary significantly for a high-resolution display, since the first
case makes 1 CSS pixel match 1 device pixel, while the other makes 1
CSS inch match 1 device inch, so it would take twice as many pixels on
a 192dpi than on a 96dpi monitor. (Assuming the UA _had_ knowledge
about the monitor dpi and used it in this case).

As per the proposed spec, the default stylesheet for displays would
have the former declaration, while the default stylesheet for print
would have the latter; a web designer could e.g. set the reference
length to be 1in 1in for monitors too.

We could probably coalesce your porposal and mine. Property name:
scaling.  Values: _percentage_ | _length_ [_length_] | inherit

With a percentage, we obtain your proposed functionality: the computed
value of any length of the element (and inner elements) is scaled by
the given proportion. With two lengths, the scaling is computed so
that the first length (in CSS units) matches the second length (in
real world units). One length is the same as two lengths with
duplicate values.

How does that sound?



-- 
Giuseppe "Oblomov" Bilotta

Received on Thursday, 21 January 2010 15:22:16 UTC