RE: [CSS21] Issue 149 - px vs. pt

> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf
> Of fantasai
> Sent: Tuesday, June 29, 2010 3:13 PM
> To: www-style@w3.org
> Subject: Re: [CSS21] Issue 149 - px vs. pt
> 
> On 06/16/2010 06:32 PM, fantasai wrote:
> > I was given an action item to write proposed wording for CSS2.1 Issue 149
> > http://wiki.csswg.org/spec/css2.1#issue-149
> > to define a fixed ratio of 4:3 for pt:px and to allow the physical value
> > of these units to vary. Since it's a multimedia section and a complicated
> > set of changes, I've posted the wording as HTML here:
> > http://fantasai.inkedblade.net/style/specs/css2.1/px-unit
> 
> I've been thinking about this issue, and I've come to the conclusion that,
> roc's original proposal to redefine points (and picas) but not the other
> units makes more sense. Here are the arguments that have convinced me:
> 
>    - We do have use cases for real, physical units. Mozilla's team,
>      for example, wants them for its mobile phone UIs.
>    - Defining mm, cm, and in relative to px has rather unexpected
>      effects on Media Queries: I can no longer query the physical
>      dimensions of my screen or viewport, only its pixel grid size.
>    - The point, as a unit, has only very recently been standardized
>      and already suffers from multiple definitions:
>        http://en.wikipedia.org/wiki/Point_%28typography%29
> 
> So here's an alternate proposal
>    http://fantasai.inkedblade.net/style/specs/css2.1/pt-unit
> that defines two groups of units:
>    * px, pt, and pc as device-relative (based on CSS px)
>    * in, mm, cm as physically-absolute
> 
> The two map together when either
>    a) we're printing, in which case CSS points map to PostScript points or
>    b) effective device resolution is unknown, in which case an inch maps
>       to 96px
> 
> This addresses the use cases for real physical units, addresses the
> web-compat problem with authors mixing points and pixels, and avoids
> redefining the millimetre. Given that roc suspects it won't break
> the Web, I'd rather go this route.
> 
> ~fantasai

The point, "pt" is just one of the absolute units that have been long defined in CSS2 and have been used in other specs, such as SVG. The relationships defined between the absolute units have existed for longer than even CSS has existed and breaking that relationship would need analysis of more than just CSS files. In particular, SVG files are likely to use inches or centimeters for the graphic parts of a drawing and points for the textual labels. If these no longer matched there would be significant complaints.

But, I think that there is a better way to approach the screen size problem. At a previous CSS F2F, we agreed that when printed, points are points, inches are inches, etc. What I propose is that we treat the "canvas" as being different than the "display screen". The absolute units relationships should hold on the canvas and the mapping of the canvas onto the screen can modify ratio of absolute units to device pixels as needed for the device. That is, if I have a box that is 6 inches tall by 9 inches wide, then this box should fill a substantial part of my screen whether that is a monitor for a desktop computer, the Jumbotron at a sports stadium or a (rotated) cell phone display. The user can then position him or herself so that the viewing angle (which defines what size a 'px" is) is appropriate for reading. It is up to the User Agent to define the mapping of the canvas to the viewing screen (and to define "px" units). It would also be possible to for a UA to have a show me the canvas so that the absolute units are faithfully mapped to the device screen. This may require the canvas to be scrolled (for small devices) or make the object essentially invisible (for the Jumbotron).

I will admit that I have not done the homework to work out whether the above proposal is effectively saying map the 'px' units to the absolute units, but I suspect that it is saying that, just saying it in a way that is one step removed from such a fixing of the 'px' size.

Steve Z.

Received on Wednesday, 30 June 2010 01:12:49 UTC