Am Dienstag, 24. September 2013, 23:27:50 schrieb Johan Engelen:
On 24-9-2013 22:16, Krzysztof Kosiński wrote:
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()
[...]
of user unit to the other units. In a document without viewbox or with non-real-unit document height&width, we have to resort to some arbitrary/default value. This default value might be what Krzysztof suggests: use whatever DPI the monitor is using. But that will cause
While you are designing something new I would like to ask you to keep those users in mind that have more than one monitor attached to the computer, using different DPI. This is especially common with laptop + external monitor setups. When moving the Inkscape window from one screen to the other it would be awesome if this ratio could somehow be updated. The technical side to know about the movement is not the problem but I guess a sudden change of px/mm ratio would confuse many parts of the current code base.
Tobias, a thankful user
[...]