
On Jan 9, 2011, at 12:48 PM, Shawn H Corey wrote:
(shudder) That gives me the creeps. Allowing a web designer to do whatever they want. Scary stuff.
The problem is with the monitors. They have to tell the OS what their resolution is (which some do) and their dpi (which none do). Until then, software must take its best guess. And anyone who thinks monitors should display images in real-life size is engaged in wishful thinking.
Most monitors I've used for years now report to the applications via the OS their DPI, including on OS X, MS Windows and Solaris & Linux via X11.
GDK provides us this handy method:
gdk_screen_get_resolution() http://library.gnome.org/devel/gdk/stable/GdkScreen.html#gdk-screen-get-reso...
Of course, one should note that 1) the function takes a screen object as a parameter... as more than one screen might be involved in a system. 2) a window might span more than one screen.
as a caution, the SVG spec does state: http://www.w3.org/TR/SVG/coords.html#Units ...
Note that use of px units or any other absolute unit identifiers can cause inconsistent visual results on different viewing environments since the size of "1px" may map to a different number of user units on different systems; thus, absolute units identifiers are only recommended for the ‘width’ and the ‘height’ on and situations where the content contains no transformations and it is desirable to specify values relative to the device pixel grid or to a particular real world unit size.
Now, the initial coordinate system in SVG is what matters: http://www.w3.org/TR/SVG/coords.html#InitialCoordinateSystem ...
If the SVG implementation is part of a user agent which supports styling XML documents using CSS2 compatible px units, then the SVG user agent should get its initial value for the size of a px unit in real world units to match the value used for other XML styling operations; otherwise, if the user agent can determine the size of a px unit from its environment, it should use that value; otherwise, it should choose an appropriate size for one px unit. In all cases, the size of a px must be in conformance with the rules described in CSS2 ([CSS2], section 4.3.2).
Quite complex, and allows for much variation.
The CSS spec includes some fun diagrams, including variable-sized pixels for display and print: http://www.w3.org/TR/CSS2/images/pixel1.png http://www.w3.org/TR/CSS2/images/pixel2.png
And that in CSS, a "reference pixel" is defined using "the visual angle". Fun, huh? Oh, and the latest CSS specs refer to 96 DPI, whereas originally they referenced 90 DPI.