Difference between revisions of "BlueprintRealUnit"

From Inkscape Wiki
Jump to navigation Jump to search
Line 4: Line 4:


== The problem ==
== The problem ==
=== Inkscape side ===
Even if the user switch everywhere the unit to mm, inkscape
convert it to px unit and write it in the .svg file resulting inaccuracies.
=== SVG side ===
All the units in svg drawing needs to be in px unit.
The grammar in the SVG specification does not allow other units then pixel:
http://www.w3.org/TR/SVG/paths.html#PathDataBNF
More information about coordinate system:
http://www.w3.org/TR/SVG/coords.html
Examples:
This is invalid in SVG:
  <path d="M 0,0 L 30mm,0 L 30mm,30mm L 45mm,30mm" id="path7887" />
The correct solution would be to specify it in pixel and after tranform it.


== Related bug reports ==
== Related bug reports ==

Revision as of 15:20, 6 June 2008

Summary

This blueprint tries to collect all information about how to implement real world units (in, mm) in a standard compliant way.

The problem

Inkscape side

Even if the user switch everywhere the unit to mm, inkscape convert it to px unit and write it in the .svg file resulting inaccuracies.

SVG side

All the units in svg drawing needs to be in px unit. The grammar in the SVG specification does not allow other units then pixel: http://www.w3.org/TR/SVG/paths.html#PathDataBNF

More information about coordinate system: http://www.w3.org/TR/SVG/coords.html

Examples: This is invalid in SVG:

 <path d="M 0,0 L 30mm,0 L 30mm,30mm L 45mm,30mm" id="path7887" />

The correct solution would be to specify it in pixel and after tranform it.

Related bug reports

 #168753: SVG defaults to pixels (90dpi) despite default units
 Duplicates: 
   #168516: Inkscape doesn't save page size units in plain svg
   #170738: preserve units
 Viewbox related bug reports:
 #171203: Use viewBox to explicitly define a coordinate system

Related discussions in the past

On the inkscape-dev mailing list:

Problem with real units (mm)