Re: [CSS21] 4.3.2 Lengths (reference pixel?)

Olaf Hoffmann:
> 
> words like centimeter and millimeter are always unambiguously related to the
> international standard unit meter,

In a context where you could reliably measure one. All of CSS’s unit identifiers can be used for any instance of a <length>. If you only have pixels (or dots) it’s useful, if not necessary, to have a common rule of approximation. (For that, I once suggested, without success, to assume the display height, which often is known, to be about 30cm at paper reading distance.)

I thought the CSSWG resolved the issue by anchoring the length units physically whenever output dimensions are known, and on the CSS pixel otherwise. Instead the current WD mandates to distinguish between high- and low-resolution devices without further details: Where’s the tipping point? In practice this often doesn’t make much a difference, though.

It was necessary to align 4px with 3pt, because much existing content relies on this. The other absolute units, i.e. ‘pc’, ‘in’, ‘mm’ and ‘cm’, are virtually unused, so only ‘pt’ points (along with ‘pc’ picas perhaps) could have been detached from the rest instead. That would have been odd, too, although there already is a plethora of typographic points out there.

If physical units are being used, it’s usually in a scenario where it’s expected that the dimensions of the (high-resolution) output device are known, so there’s no harm done to SI there. I agree in so far with you, that it’s undesirable to have physical units scaled when the system could have done better, because it knew its environment.

> Within CSS is is clearly incompatible with previous recommendations

It is, but this can be considered an erratum, because most implementations and authors already did it the CSS 2.1 way and not the CSS 1 / 2.0 way anyhow.

> Useful could be something like:
> 
> in: inches — note, that 1in is equal to 2.54cm.
> cm: centimeters
> mm: millimeters
> pt: points — 1/72nd of 1in. 
> pc: picas — 1pc is equal to 12pt.
> px: pixel units — a device pixel
> rpx: reference pixel — as explained below

‘px’ has never been used in CSS to mean a device pixel (except in MQ). When introducing new units we could do it like this:

Absolute units
==============

Physical units
--------------
Level 2.1
  in:  inch, 1in = 25.4mm
  cm:  centimeter, 1cm = 10mm
  mm:  millimeter, if the physical size cannot be determined
either 1mm is 1/300th of the display|viewport height, 300mm = 1vh
    or 127mm = 480px (i.e. 96 px/in)
Level 3
  cc:  cicero, 1cc = 12dd
  pc:  pica, 1pc = 12pp
  dd:  didot, 8dd = 3mm
  ps:  point, 72pp = 1in (after ‘PostScript’)
  um:  micrometer, 1000um = 1mm

Device units
------------
Level 2.1
  pt:  point, 3pt = 4px
  px:  pixel, the best integer approximation of the reference pixel,
       or 96px = 1in if the former definition is impossible to determine
Level 3
  dot: smallest picture element that can have every of all the colors
       the display device supports, 
       1dot = 1px if information not available

‘ps’ in Level 3 is the same as ‘pt’ in Level 2.0 and earlier, and 1ps = 1pt in most cases in Level 2.1 and up.

Received on Monday, 13 December 2010 19:47:06 UTC