Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Background information:
The width and height attributes in the root svg element of an svg file determine the size of the viewport, in other words the size of the svg document when it is viewed. The coordinates of the objects in the svg file are specified in user space, which is different from the viewport space. The viewBox attribute in the root svg element defines the rectangle in user space that should be mapped to the edges of the viewport. The preserveAspectRatio attribute in the root svg element determines how this mapping takes place. This mapping uses one of three possible methods: "meet", "slice" or "none". See http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute and http://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute for more detailed information.

Determining the rotation anchor point for an SVG object in user space coordinates

To determine the rotation anchor point for an SVG object in user space coordinates using Inkscape, do the following. Open the SVG file in Inkscape. Select the object. Select menu "Edit", then select "XML Editor". Then in the window that opens, in the box on the right, look for the important attributes (e.g. "x", "y", "width", "height", "transform" or "d") and use their values to calculate the required anchor point. E.g. to rotate a "rect" svg object with attributes width="200" height="200" x="500" y="300" transform="translate(50 0)" around its center, use anchor point coordinates (x, y) = (650, 400).

Aligning text within svg text objects

...