24 Sep
2013
24 Sep
'13
8:16 p.m.
2013/9/24 <ian_bruce@...2136...>:
The other absolute unit identifiers from CSS (i.e., pt, pc, cm, mm, in) are all defined as an appropriate multiple of one px unit (which, according to the previous item, is defined to be equal to one user unit), based on what the SVG user agent determines is the size of a px unit (possibly passed from the parent processor or environment at initialization time). For example, suppose that the user agent can determine from its environment that "1px" corresponds to "0.2822222mm" (i.e., 90dpi). Then, for all processing of SVG content: - "1pt" equals "1.25px" (and therefore 1.25 user units) - "1pc" equals "15px" (and therefore 15 user units) - "1mm" would be "3.543307px" (3.543307 user units) - "1cm" equals "35.43307px" (and therefore 35.43307 user units) - "1in" equals "90px" (and therefore 90 user units)
So it seems that 1px should ideally correspond to 1in / dpi of the monitor. E.g. the units are supposed to map 1:1 to the real world when the document is displayed at 100% zoom.
The px, pc, mm, cm, in ratios are fixed, so it seems like they can be compiled in, while the DPI value could be obtained from the EDID of the monitor. GDK has functions which can be used for this:
gdk_screen_get_monitor_geometry() gdk_screen_get_monitor_height_mm() gdk_screen_get_monitor_width_mm()
Regards, Krzysztof