Class SvgWriter
java.lang.Object
com.codename1.art.SvgWriter
Writes an ArtDocument as SVG.
Shapes, paths, groups, gradients, image paints, clips, masks, text and blend modes are written as SVG. Effects with an SVG filter equivalent (blurs, shadows, color matrices and SVG filter graphs) become filters. A node whose effects SVG cannot express (a bevel, a curves adjustment) and every adjustment layer is written as the image it renders to, so the output looks the same in any SVG viewer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringPath data for a path.setRasterScale(double scale) Sets the resolution, in pixels per unit, of nodes written as images.toSvg(ArtDocument doc) The SVG text of a document.static voidwrite(ArtDocument doc, OutputStream out) Writes a document.
-
Constructor Details
-
SvgWriter
public SvgWriter()
-
-
Method Details
-
setRasterScale
Sets the resolution, in pixels per unit, of nodes written as images.
Parameters
scale: pixels per document unit
-
write
Writes a document.
Parameters
doc: the documentout: receives UTF-8 SVG; not closed
- Throws:
IOException
-
toSvg
The SVG text of a document.
Parameters
doc: the document
-
pathData
Path data for a path.
Parameters
p: the path
-