User:Yiming/GSoC2019/SVG

= SVG stuff =

Why
Workflow reasons. Easy connect different software.

SVG format
Here discusses the format that the proposed SVG exporter follows:

Reference from w3.org

  Example triangle01- simple example of a 'path' A path that draws a triangle  

The main thing here is the   tag. d describes the points. The leading characters in the d string represent following meanings: (The table only includes the commands that are used in our exporter)

How to fill the :

An example of this can be like the following, please note that you can insert new lines as space for visual clarity.

To minimize the file size, the space between a command and a value can be omitted. For example, this is perfectly ok:

Please note that the space between argument values can not be omitted.

For the fill and stroke part, they both describes color. If the tag is not present, then the path won't have such property.

In Blender, Grease pencil width value is measured 1000 as 1 Blender Unit, which is the size of a default viewport floor grid.

In SVG, if the unit is not specified, then values are all treated as px. We should follow this standard throughout the exporting process. In order to achieve DPI scale, we can specify width and height in the SVG header alone with viewbox property. If you have a 1000px wide viewbox, with a width set to 5 inch, then tis SVG file will be interpreted as a 200 dpi file (in width direction).