Search processing.org:

## Candy SVG Import

Candy is a minimal SVG import library for Processing. Candy was written by Michael Chang, and later revised and expanded for use as a Processing core library by Ben Fry.

Before creating an applet or application, you must first import the Processing XML library whenever using the Candy library. Simply use Sketch → Import Library → xml, after importing candy. Otherwise, sketches will not run in a web browser or by themselves as applications. A future release of Processing will automatically take care of this dependency.

SVG (Scalable Vector Graphics) is a portable graphics format. It is a vector format so it allows for infinite resolution and small file sizes. Most modern media software can view SVG files, including Firefox, Adobe products, etc. You can use programs like Illustrator and Inkscape to edit SVG files.

This library was specifically tested under SVG files created from Adobe Illustrator. We can't guarantee that it'll work for any SVG's created from anything else. In the future we'll also test with open source graphics editing software for maximal compatibility. In the interim, you're on your own.

An SVG created under Illustrator must be created in one of two ways:

- File → Save for Web (or control-alt-shift-s on a PC). Under settings, make sure the CSS properties is set to "Presentation Attributes".
- With Illustrator CS2, it is also possible to use "Save As" with "SVG" as the file setting, but the CSS properties should also be set similarly.

Saving it any other way will most likely break Candy.

##### SVG Class

SVG
draw()
drawMode()
ignoreStyles()
get()
print()