jfree / jfreesvg

A fast, lightweight Java library for creating Scalable Vector Graphics (SVG) output.
http://www.jfree.org/jfreesvg
GNU General Public License v3.0
319 stars 58 forks source link

Drawing with path data string? #46

Closed codelocksdev closed 2 years ago

codelocksdev commented 2 years ago

Is drawing a path directly using the standard path data format supported? I can't seem to find any methods that look like they might do that in the API docs.

jfree commented 2 years ago

Hi, JFreeSVG is implementing the Graphics2D API, so to draw paths you need to create a GeneralPath or Path2D instance and then call the draw(Shape) or fill(Shape) method.

Maybe this can help: https://www.jasperpotts.com/blog/2007/07/svg-shape-2-java2d-code/