Re: Investigate SVG support

10 views
Skip to first unread message

Michael Heuer

unread,
Aug 27, 2008, 5:24:58 PM8/27/08
to piccol...@googlegroups.com
Stepping back a bit on this issue, I see at least four different ways
to support SVG in Piccolo2D:

* Render SVG directly in the paint method of a subclass of PNode
* Render SVG into an image and display that image in a PImage node
* Render SVG into an Swing component and display that component via PSwing
* Render SVG by mapping SVG elements to PNodes (PLine, PPath, etc.)

All of the first three can all be implemented with

Apache Batik
http://xmlgraphics.apache.org/batik/

and with

SVG Salamander
https://svgsalamander.dev.java.net/


The second with

Candy SVG Import
http://processing.org/reference/libraries/candy/index.html


There might be others.

Perhaps it might be useful to document and provide examples of all of
these before we get too far on the fourth option?

michael

M. Rohrmoser

unread,
Aug 28, 2008, 7:50:59 AM8/28/08
to piccol...@googlegroups.com
Michael Heuer schrieb:

> Perhaps it might be useful to document and provide examples of all of
> these before we get too far on the fourth option?

I fully agree. Implementing proper SVG coverage is both out of scope (a
terrible lot of work) and a bit off-topic for piccolo2d. And there are
some libs that do this yet.

I want to make an experiment and see if a simple import is feasible and
how it could be done. Most out of curiosity. The advantage of import
over rendering might be that the result is PNodes you can attach event
handlers to and change the nodes at runtime. The svg then defines the
look of the zui.

I'll put all the options you mentioned in the wiki.

M

Reply all
Reply to author
Forward
0 new messages