On 2006-09-10, Boris Zbarsky <[EMAIL PROTECTED]> wrote:
> Ben Hutchings wrote:
>> - font sizes specified in pixels are scaled according to the
>>   nominal screen resolution as if 1 px means 1/96 inch
>
> That's pretty much what 1 CSS px means, yeah.  Except for the minor
> detail about viewing distance being different... :(

I thought 1 pixel meant 1 pixel, the clue being in the name. ;-)

Am I right in thinking that the distances are being scaled because
it's common practice to specify everything in pixels, resulting in
unreadable web sites?  Personally, I have been happily avoiding
that problem in Firefox 1.0 by setting both normal and minimum font
sizes to the smallest size I can comfortably read, and think this
is a far superior solution.

> There's work being done in 1.9 to make this mess better.
>
>> - font sizes specified in point sizes are scaled according to a
>>   fixed screen resolution of 96 dpi
>
> This sounds odd.

Indeed!  I dug through the code and can't see why this is.
nsDeviceContext and nsDeviceContextGTK are almost unchanged between
1.7 and 1.8.  nsDocShell calls DevUnitsToTwips on the device
context, gets 36 (= 1440/40 as expected) and passes that back into
SetDevUnitsToAppUnits.  Nowhere do I see the figure of 96.

Here's a table of the behaviour, for reference.  "Assumed
resolution" means the browser.display.screen_resolution setting.
"Requested size" means the size specified using CSS.

Mozilla   Assumed    Requested     Actual size
version  resolution    size     (pixels) (inches)
           (dpi)

  1.7    default:96    20 px       20      0.5
  1.7    default:96    36 pt       48      1.2
  1.7        40        20 px       20      0.5
  1.7        40        36 pt       20      0.5
  1.8    default:96    20 px       20      0.5
  1.8    default:96    36 pt       48      1.2
  1.8        40        20 px       48      1.2
  1.8        40        36 pt       48      1.2

Ben.

-- 
Ben Hutchings -- [EMAIL PROTECTED] shortened to [EMAIL PROTECTED]
If you've signed my GPG key, please send a signature on and to the new uid.
The world is coming to an end.  Please log off.
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to