On 27/02/2012 08:02, Erik Lundgren wrote:
We don't target the html/css stack yet. But we want to. So i think it is 
important to count it in as soon as possible.

CSS rendering of "real world units" seems stable but does not work exactly the 
way you would expect.

CSS user agents assumes a 96 ppi screen [1]. On my 113 ppi screen a 10 cm div 
renders as a 8.5 cm div. Exactly the behavior I don't want: 1 cm in code, 85 mm 
on screen.

This may of course still be helpful as a fixed northern star. Given the 96 ppi 
and the browsers rendering we could calculate the run time screens ppi: 96 / 
(8.5 / 10) ).

In the HTML/CSS world dpi is "preset" and can be changed for accessability: For example in Chrome you can set the zoom to 150%. Then the cm size changes too! In other words the unit naming is misleading - utterly wrong - but it is the basis browsers use. There are extensions [1] available the set this zoom factor to the value that actually matches the screen. Internet explorer actually allows to get a the native dpi using screen.deviceXDPI [2]. If you are on windows the dpi will be taken using global scaling settings that can be changed in the control panel [3].

Here is the big problem with these settings: They can change over time. Current documentation on mobile dpi for Flex 4.6 [4] says to use the "initialization" [5] - That means that the layout and the sizes are not updated when the dpi changes. The dpi can change on mobile devices for example if you connect a HDMI monitor on the mobile device. It also takes the FlexGlobals.topLevelApplication but if you develop in AIr the screen size actually should be determined using the screen on which "most of the application" is. That is not supported in windows 7 but it could be by flex applications ....

yours
Martin.

PS.: I don't use mac what makes me slightly less interested in a solution for Mac. Sad-Linux-Panda.


[1] https://chrome.google.com/webstore/detail/pboiiapkapflomkknmedcjmhdfepfdje [2] http://msdn.microsoft.com/en-us/library/ms533721(v=vs.85).aspx <http://msdn.microsoft.com/en-us/library/ms533721%28v=vs.85%29.aspx> [3] http://msdn.microsoft.com/en-us/library/ie/aa770067(v=vs.85).aspx#highDPI_activating_settingDPI <http://msdn.microsoft.com/en-us/library/ie/aa770067%28v=vs.85%29.aspx#highDPI_activating_settingDPI> [4] http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c682e5a9412cf5976c17-8000.html [5] http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c682e5a9412cf5976c17-8000.html#WS19f279b149e7481c-6bd5f36412cc794cd7a-8000

Reply via email to