Re: [Sodipodi-list] Re: 0.8 multiplier
On Sat, 2003-12-13 at 05:10, Lauris Kaplinski wrote:
(this is why all examples in the SVG spec specify a viewBox)
Thinking about this, if Sodipodi intends to be completely interoperable, it needs to always write a default viewBox according to the base units/points mapping it imposes.
e.g. for a document 100ptx100pt, the viewBox should be "0 0 125 125".
Are you saying, that 'width' and 'height' attributes of outermost SVG have different semantics, as the same attributes in inner elements? AFAIK it is not the case, so viewBoxonly changes the meaning of: A) Percentages (as these are not defined as % of viewbox) B) Base units by ratio of width/viewBox_width and height/viewBox_height
- but as width and height are in relative units, this is no
different that applying 'transform'.
Consider these two SVG documents (I'll leave out namespace/XML declarations and other boilerplate for brevity):
<svg width="100pt" height="100pt"> <rect x="12.5" y="12.5" width="100" height="100" fill="black" stroke="none"/> <rect x="10pt" y="10pt" width="80pt" height="80pt" fill="none" stroke="red" stroke-width="1pt"/> </svg>
and:
<svg width="100pt" height="100pt" viewBox="0 0 125 125"> <rect x="12.5" y="12.5" width="100" height="100" fill="black" stroke="none"/> <rect x="10pt" y="10pt" width="80pt" height="80pt" fill="none" stroke="red" stroke-width="1pt"/> </svg>
Well, hrm. Having just tried this with Batik, I think it reveals a fundamental misunderstanding I had about viewBox.
So, for the document root it appears that the relationship between pixel and non-pixel measurements can never be guaranteed to be fixed between different UAs/display devices.
Doesn't this mean that Sodipodi should probably be using pixel measurements, not real-world units, for the height/width properties of the root SVG element? (and probably using e.g. sodipodi:height and sodipodi:width, or possibly sodipodi:dpi to derive the real-world measurements the UI uses?)
Otherwise, in other SVG UAs, the relationship between the drawing and page size is not guaranteed to be the same.
-mental
participants (1)
-
MenTaLguY