com.android.ide.common.vectordrawable
Class Svg2Vector
java.lang.Object
com.android.ide.common.vectordrawable.Svg2Vector
public class Svg2Vector
- extends java.lang.Object
Converts SVG to VectorDrawable's XML
There are 2 major functions:
1. parse(file)
This include parse the .svg file and build an internal tree. The optimize this tree.
2. writeFile()
This is traversing the whole tree, and write the group / path info into the XML.
Method Summary |
static java.lang.String |
parseSvgToXml(java.io.File inputSVG,
java.io.OutputStream outStream)
Convert a SVG file into VectorDrawable's XML content, if no error is found. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SVG_POLYGON
public static final java.lang.String SVG_POLYGON
- See Also:
- Constant Field Values
SVG_POLYLINE
public static final java.lang.String SVG_POLYLINE
- See Also:
- Constant Field Values
SVG_RECT
public static final java.lang.String SVG_RECT
- See Also:
- Constant Field Values
SVG_CIRCLE
public static final java.lang.String SVG_CIRCLE
- See Also:
- Constant Field Values
SVG_LINE
public static final java.lang.String SVG_LINE
- See Also:
- Constant Field Values
SVG_PATH
public static final java.lang.String SVG_PATH
- See Also:
- Constant Field Values
SVG_ELLIPSE
public static final java.lang.String SVG_ELLIPSE
- See Also:
- Constant Field Values
SVG_GROUP
public static final java.lang.String SVG_GROUP
- See Also:
- Constant Field Values
SVG_TRANSFORM
public static final java.lang.String SVG_TRANSFORM
- See Also:
- Constant Field Values
SVG_STYLE
public static final java.lang.String SVG_STYLE
- See Also:
- Constant Field Values
SVG_DISPLAY
public static final java.lang.String SVG_DISPLAY
- See Also:
- Constant Field Values
SVG_D
public static final java.lang.String SVG_D
- See Also:
- Constant Field Values
SVG_STROKE_COLOR
public static final java.lang.String SVG_STROKE_COLOR
- See Also:
- Constant Field Values
SVG_STROKE_OPACITY
public static final java.lang.String SVG_STROKE_OPACITY
- See Also:
- Constant Field Values
SVG_STROKE_LINEJOINE
public static final java.lang.String SVG_STROKE_LINEJOINE
- See Also:
- Constant Field Values
SVG_STROKE_LINECAP
public static final java.lang.String SVG_STROKE_LINECAP
- See Also:
- Constant Field Values
SVG_STROKE_WIDTH
public static final java.lang.String SVG_STROKE_WIDTH
- See Also:
- Constant Field Values
SVG_FILL_COLOR
public static final java.lang.String SVG_FILL_COLOR
- See Also:
- Constant Field Values
SVG_FILL_OPACITY
public static final java.lang.String SVG_FILL_OPACITY
- See Also:
- Constant Field Values
SVG_OPACITY
public static final java.lang.String SVG_OPACITY
- See Also:
- Constant Field Values
SVG_CLIP
public static final java.lang.String SVG_CLIP
- See Also:
- Constant Field Values
SVG_POINTS
public static final java.lang.String SVG_POINTS
- See Also:
- Constant Field Values
presentationMap
public static final com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> presentationMap
Svg2Vector
public Svg2Vector()
parseSvgToXml
public static java.lang.String parseSvgToXml(java.io.File inputSVG,
java.io.OutputStream outStream)
- Convert a SVG file into VectorDrawable's XML content, if no error is found.
- Parameters:
inputSVG
- the input SVG fileoutStream
- the converted VectorDrawable's content. This can be
empty if there is any error found during parsing
- Returns:
- the error messages, which contain things like all the tags
VectorDrawble don't support or exception message.