RE: Making pt a non-physical unit

Tuesday January 05, 2010, 6:06 AM from Robert@ocallahan.org:

 

>My understanding from a conversation I had on #webkit is that Webkit avoids the problem by treating 1pt as 4/3px regardless of

>the display DPI.

 

In my tests - in Internet Explorer the ratio is likewise 4/3px. In other words, 12pt is 9px and this holds true at all levels of logical zoom. (Rounded out, obviously, depending.) I had no idea, frankly, that FF attempted some other calculation.

 

> if a browser strictly adheres to the spec and treats 1pt as 1/72in

How is this even possible without knowing the actual physical dimensions of the display? It isn’t possible. At least not in any meaningful interpretation of that phrase from the spec. How do you calculate 1/72nd of an inch for two different LCD displays, both set at a resolution of 1440 in width when one display is 20 inches wide and the other is 16 inches wide without knowing that one is 20 inches wide and the other 16 inches wide? You can’t.

In contrast, printers communicate to the OS the precise physical size of the paper. So specifying a size of 1/72nd of an inch makes perfect sense. As a unit within a print style sheet, pts make sense and should be preserved as physical units. 

But until displays reliably and consistently announce their physical size in the same way as printers announce the size of the paper “codex” being used, the 4/3 ratio seems to work about as well as anything else.

 

>I don't think we need to give up on physical units entirely

I find it astonishing that – how many years after the “plug ‘n’ play” spec was first implemented? – displays do not, as a matter of course, communicate their physical dimensions to the OS.

I had a brief conversation with Dr. Kevin Larsen, Microsoft’s screen readability researcher, about this earlier last year – the gist being that Microsoft is urging display manufacturers to design their devices to provide more useful information than they historically have done.

For physical units to work, you need to know the physical dimensions of the output device. Resolution – the grid-based subdivision - tells only a part of the story.

But by all means, let’s preserve the physical units for print and let’s leave the door open for those instances where the display, like a printer, *does* provide its physical dimensions.

 

Regards, 

 

Rich

From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf Of Robert O'Callahan
Sent: Tuesday January 05, 2010, 6:06 AM
To: www-style
Subject: Making pt a non-physical unit

 

Various Web sites specify font sizes for some content in pt [1]. They look fine in most browsers, but a length in pt that looked the same as a px length when DPI was 96 will be 50% longer than that px length when the DPI is 144. Consequently, if a browser strictly adheres to the spec and treats 1pt as 1/72in, these sites look bad, broken, or unusable. The problem is especially acute for mobile devices, because their screens are often both high-density and small.

My understanding from a conversation I had on #webkit is that Webkit avoids the problem by treating 1pt as 4/3px regardless of the display DPI. I think we probably need to do this in Gecko for Web compatibility reasons, and so for the sake of honesty in Web specifications, I propose that the definition of pt in CSS be altered accordingly.

(At this time, I don't think we need to give up on physical units entirely; all the problematic sites I'm aware of are misusing pt, but not mm or in. mm remains useful for specifying the dimensions of touch-based interfaces.)

[1] E.g. the search <select> on http://amazon.com; the title at http://blogs.mercurynews.com/kawakami; pretty much all the content at http://thenokiablog.com. You can see the results for yourself in Firefox by opening about:config and setting layout.css.dpi to 180 or so.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]

Received on Tuesday, 5 January 2010 14:57:21 UTC