On Tue, 24 Sep 2013 23:27:50 +0200 Johan Engelen <jbc.engelen@...2592...> wrote:
On 24-9-2013 22:16, Krzysztof Kosi\u0144ski wrote:
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.
It is surely unsurprising that if somebody chooses to dimension their drawing in inches, millimetres, or kilometres, that these units are supposed to relate to the real world.
However, it is not clear that every drawing needs to be displayed at a real-world scale of 1:1 . If some drawing contains a feature with a dimension of "100 inches", then it is unlikely that the whole thing can ever be displayed at full scale; if the dimension is "100 kilometres", it is clearly impossible.
Rather than interpreting "100% zoom" to mean "display at a real-world scale of 1:1", a better interpretation would be "display the drawing at the most appropriate and convenient scale for viewing and working on it." This will often, but not always, be such that the displayed size of the drawing is approximately the physical size of the monitor.
The author of the document is the best judge of exactly what display scale a zoom setting of 100% should produce, so there ought to be a per-document preference setting to control this.
I believe that the pc, mm, cm, in ratios are fixed (duh ;), but *not* the "px"/"user unit" ratio.
The px/user-unit ratio is very much fixed, at 1:1 , according to the SVG specification. But perhaps by saying "px/user-unit" you meant to suggest not a ratio, but the equivalence of those terms?
The viewbox (together with a defined document height and width in real-world units) defines the ratio of user unit to the other units.
Surely whatever unit is selected as the document default should then be considered equivalent to "user units" and "px", thus defining their ratios to other units?
Unless, of course, "px" is the document default, in which case we need a preference setting, as above, to control what display scale "100% zoom" actually produces.
In a document without viewbox or with non-real-unit document height&width, we have to resort to some arbitrary/default value.
Or an explicit preference setting controlling the ratio of document units to real display units, again at 100% zoom; other zoom factors will rescale the display accordingly.
This default value might be what Krzysztof suggests: use whatever DPI the monitor is using. But that will cause non-viewbox documents to be shown with different sizes (mm, in, cm,...) on different machines.
Monitor DPI is only relevant if the user intends to dimension their drawing in terms of "pixels". Even if they use real physical units, it is not clear that the default display scale should be 1:1 . As I suggested above, if the nominal size of the drawing is on the order of 100 inches, and it's being viewed on a 27-inch monitor, then a zoom setting of 100% should probably NOT produce a real display scale of 1:1 ; it would probably be better to choose a scale such that the borders of the document were aligned with the edges of the monitor.
But the best person to decide this question is the document author, so there should be a preference setting to control it directly.
Confusing for people perhaps, because the default Inkscape document does not specify the relation between user units and real-world units, and so in that case if someone thinks he is using "mm", he is actually using an ill-defined "mm".
If someone thinks they are using millimetres, it would be best if nothing happens to contradict that belief. If there is an explicit "Display Scale Factor" preference setting, they can control whether 100% zoom produces a 1:1 ratio of document millimetres to screen millimetres, or some other value, of their choosing. It's only ill-defined if people are given no way of defining it.
I think it is better to have some fall-back dpi value stored in the preferences, so people have better control over it and can handle interoperability better (on documents without proper scale definition).
"DPI" means "dots (pixels) per inch", and since we've established that SVG "px" have no necessary connection with pixels, it doesn't seem to be a very relevant concept. But as you say, there needs to be something in the preferences, so that people can directly control the default (100% zoom) scale their drawing is displayed with, regardless of what units they use to dimension it.
If it's not already clear, I think that preference setting should directly control the default ratio of document units to physical screen units; this would be multiplied with the zoom factor setting when the document was actually rendered on the display. In addition to "px" and real physical units, it should be possible to select the width or height of both the drawing and the screen; you could then specify that the document should be displayed so that its width (or height) was the same as (or half, or twice) that of the screen.
The PNG image attached to this message shows what such a preference dialog might look like: two number boxes, and two selection lists, to specify the ratio between document units and physical display units.
I have previously posted an extended discussion of these issues, archived here:
http://sourceforge.net/mailarchive/forum.php?thread_name=20121104003312.162f...
-- Ian Bruce