jung-kurt / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/jung-kurt/gofpdf
MIT License
4.34k stars 787 forks source link

SVG closepath support #229

Closed joewestcott closed 5 years ago

joewestcott commented 5 years ago

Adds closepath (z or Z char) support to SVG handling.

closepath in the w3 SVG specification: https://www.w3.org/TR/SVG11/paths.html#PathDataClosePathCommand

jung-kurt commented 5 years ago

Thanks @joewestcott!

eiskasten commented 5 years ago

It does not. It just let the error handling not complaining about the z command, as it does not add it to the []SVGBasicSegmentType. In addition, the calculation for the beginning coordinate is not correct as it takes always the origin coordinate and not the last move to instruction (from which multiple one can exist in one path) and even if the path contains only one move to instruction it is the wrong coordinate.

However, I fixed that in my pull request which adds support for some other instructions too. #295