Class SvgReader
java.lang.Object
com.codename1.art.SvgReader
Reads SVG 1.1 and SVG 2 static documents into an ArtDocument.
Covers shapes and paths, groups, nested svg, use with symbol, switch,
presentation attributes, inline styles and <style> sheets (type, class, id and
compound selectors), gradients with href inheritance, patterns, clipPath, mask,
every filter primitive, text with tspan, image with data URLs and resolved links,
mix-blend-mode and viewBox with preserveAspectRatio. Markers are expanded into
shapes. Animation and scripts have no static meaning and are reported as notes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceLoads what anhrefnames. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse(InputStream in) Reads an SVG document with this reader's settings.static ArtDocumentread(byte[] data) Reads an SVG document from bytes.static ArtDocumentread(InputStream in) Reads an SVG document.setResolver(SvgReader.ResourceResolver resolver) Sets what loads linked images and documents; without one only data URLs are read.static MatrixParses an SVGtransformattribute.
-
Constructor Details
-
SvgReader
public SvgReader()
-
-
Method Details
-
setResolver
Sets what loads linked images and documents; without one only data URLs are read.
Parameters
resolver: the resolver, or null
-
read
Reads an SVG document.
Parameters
in: the document; not closed
- Throws:
IOException
-
read
Reads an SVG document from bytes.
Parameters
data: the document
- Throws:
IOException
-
parse
Reads an SVG document with this reader's settings.
Parameters
in: the document; not closed
- Throws:
IOException
-
transform
-