W3C home > Mailing lists > Public > www-style@w3.org > January 2010

Making pt a non-physical unit

From: Robert O'Callahan <robert@ocallahan.org>
Date: Wed, 6 Jan 2010 00:05:39 +1300
Message-ID: <11e306601001050305l2ed39f00w7d9563fbb625bd31@mail.gmail.com>
To: www-style <www-style@w3.org>
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.

"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
Received on Tuesday, 5 January 2010 11:06:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:42 UTC