Re: Making pt a non-physical unit

On Tue, Jan 5, 2010 at 12:05 PM, Robert O'Callahan <robert@ocallahan.org> wrote:
> 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.

Honestly, I don't like this idea. Not only it is wrong in principle,
but it also breaks the layouts of anybody using pt correctly as a
physical unit; it also breaks uses of CSS beyond screen rendering,
unless you only plan to do the pt = 4/3px for screen rendering only.

Rather, aside from pressuring the websites of broken pages to fix
their stylesheets, I would rather see some way for UA to fix the
broken pages by either forcing a specific dpi or overriding the pt
value; but this would have to be done for specific pages, for example
the way Opera does this via browser js to fix sites that fail to work
in it.


-- 
Giuseppe "Oblomov" Bilotta

Received on Tuesday, 5 January 2010 17:23:37 UTC