Re: [CSS21] [css3-values] px and device pixels

fantasai wrote:
> 
> I always thought it was in the spec, but it seems to be an unwritten
> assumption, that CSS 'px' units should map to a whole number of device
> pixels. The examples in the spec all assume rounding to a whole number
> of device pixels. And while I don't think we should absolutely require
> this (I know on printers defining "device pixel" is not straightforward),
> I think it should be recommended as something to aim for.
> 
> Proposed change:
> 
> Replace
>   "the user agent should rescale pixel values"
> with
>   "the user agent should rescale pixel units to a different whole number
>   of device pixels"

That is not feasible I think. The train have left the station already.

(CSS px happens to be equal 1/96 of inch[1]. So it is not a physical 
unit but rather logical one. The same ratio is observed for HTML pixel 
units in all major UAs)

<table width="800"> and <div style="width:800px"> fit almost exactly on
printing paper of letter format (8.5in == 816px). All UA's print html 
this way.

If to rescale pixel units then it means width:800px should be rendered
differently on user's printer. How it supposed to work?

> 
> OR
> 
> Insert before
>   "It is recommended that the reference pixel be..."
> the sentence
>   "It is recommended that the pixel unit refer to the whole number of
>   device pixels that best approximates the reference pixel."
> 

I'd suggest to introduce new length unit - physical pixel
- that is "naked" number (without any special unit designator).

[1] http://www.w3.org/TR/CSS21/syndata.html#length-units

-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Saturday, 22 March 2008 07:46:35 UTC