Can SVG <path> contain both absolute and relative commands?

I am currently developing an application that converts SVG paths created by Inkscape. Now I do not know about the specification of the path relative to absolute and relative combinations of paths. Does the specification indicate a path that contains relative and absolute codes at the same time?

Essentially refers to the absolute Bezier curve, followed by the relative reduced Bezier curve?

If this case is possible, then I need to calculate and save the current absolute path to make sure that I can calculate the first control point of the relative abridged curve.

Should I ask a question to the Inkscape authors?

+4
source share
2 answers

Yes it is possible. using uppercase and lowercase commands, such as l and L (which means the string) in the data of the SVG path works for ex d="M 10,10 L 20,20 l 20,20" (M), moves the pen to (10,10) an absolute point, then (L) draws a line from (10, 10) to (20,20) absolute points and, finally, (1) draws a line from (20,20) absolute points to (20,20 ) relative point, which is equal to (40.40) absolute point

+6
source

Mixes of absolute and relative path commands are allowed. If you are implementing a tool, I would advise you to read the specification and the road data section in particular.

+5
source

Source: https://habr.com/ru/post/1314315/


All Articles