I want to make a new document with page-size a square of 140mm sides. In addition, the center of the square should be at (0,0). Setting the sides is easy, but I don't succeed to put the origin to the center of the square.
(And what is the purpose of the "view box" setting?. Even if I set x and y to -70 each, the origin remains at the upper-left corner)
In Inkscape, if you change the viewBox back to 0 for x and y in my attached .svg, the content (circle) is shifted to reflect your changes to the origin.
Other SVG editors may also reflect this on the ruler and other places. One example is the online editor Boxy SVG. https://boxy-svg.com/app
I made that with your file and result is clearly visible. Thanks also for the Link. very powerful prog indeed. I am also impressed by the tutorial there. (I use Notepad++, after all it is better than a pure text-editor)
Notepad++ is fine to view all kinds of source code.
When I make a new doc with display units px and page-size also in px and draw a rectangle, the coordinates of viewBox and the rectangle in Notepad++ are in mm. Why not in px-Units?
I want to make a new document with page-size a square of 140mm sides. In addition, the center of the square should be at (0,0). Setting the sides is easy, but I don't succeed to put the origin to the center of the square.
(And what is the purpose of the "view box" setting?. Even if I set x and y to -70 each, the origin remains at the upper-left corner)
To my knowledge we just can have the origin set at bottom- or upper-left side - changes needs restart though.
(good old Freehand allows to drag to where you need it) Not sure if there any changes planned.
In Inkscape, if you change the viewBox back to 0 for x and y in my attached .svg, the content (circle) is shifted to reflect your changes to the origin.
Other SVG editors may also reflect this on the ruler and other places. One example is the online editor Boxy SVG.
https://boxy-svg.com/app
I made that with your file and result is clearly visible. Thanks also for the Link. very powerful prog indeed. I am also impressed by the tutorial there. (I use Notepad++, after all it is better than a pure text-editor)
Notepad++ is fine to view all kinds of source code.
When I make a new doc with display units px and page-size also in px and draw a rectangle, the coordinates of viewBox and the rectangle in Notepad++ are in mm. Why not in px-Units?
Attached the File
Display units do not make changes to your viewBox. Scale is used for this in Inkscape.
If I put the page-size in mm, Scale is 1, so ViewBox is in mm.
If I put the page-size in px (For width of 210mm, it is 793.70081 in Pixel), Scale is 0.26458.
793.7 x 0.265 = 210.
Also in SVG/XML, the ViewBox is always in mm.
The second question is, why Coordinates of Rectangle in XML are always in mm, even if I set the Doc-Properties to px.
Should I open a new thread, as the topic has changed?
Yes, the viewBox in Inkscape default template is in mm. Scale must be changed to 1.00 user unit per pixel.
ok. fine. But the question is, where scale is stored?
Want to learn a bit about svg now Found nice tutorial..
Scale is not stored. Scale is the calculated result of width, height and viewBox on outer svg.
I set scale to 1, as you wrote it. So widh and viewBox are equal. But how does Inkscape know, if viewBox is in px or in mm?
By reading the unit identifier for width and height on outer svg. (No unit identifier = pixels)