candy SVG Candy is an open source, minimal SVG import library for Processing. The last build for SVG Candy was for Processing version 0118. SVG stands for Scalar Vector Graphics, a portable graphics format. It is a vector format so it allows for infinite resolution and relatively minute file sizes. Most modern media software can view SVG files, including Firefox, Adobe products, etc. You can use something like Illustrator to edit SVG files. This library was specifically tested under SVG files created from Adobe Illustrator. I can't guarantee that it'll work for any SVG's created from anything else. In the future I will also test with open source graphics editing software so we'll reach maximal compatibility.
Supported Features + Fills and borders Installation You will need the latest version of proXML for Candy to work. Once you have that, download and extract Candy to Restart Processing if it is already started. Usage An SVG created under Illustrator must be created in the following manner: File->Save for Web (or control-alt-shift-s on a PC)
. example
(here, "P5SVG" is just a custom name I made for these settings) Saving it any other way will most likely break Candy. A minimal example program using Candy: (assuming a working moo.svg is in your data folder)
import proxml.*;
import candy.*;
SVG moo;
void setup(){
size(400,400);
moo = new SVG("moo.svg",this);
}
void draw(){
moo.draw();
}
Note that proxml is imported as well. This is not needed when Methods
draw()
customStyle()
SVGStyle()
printSVG()
Known Issues Filled beziers will look messed up under OPENGL and P3D. This is not Candy's fault. File a petition, or something, at http://www.processing.org/discourse to get 3D/GL bezier fills fixed. If you experience any other weirdness or bugs, please file them to flux -dot- blackcat -at- gmail -dot- com with subject: Delicious Candy List of Changes |