/VectorDrawable2Svg

Converts Android VectorDrawable .xml files to .svg files

Primary LanguagePythonMIT LicenseMIT

VectorDrawable2Svg

Original repo does not have release tags, so we fork the repo to add tags and ensure versioning.

To set up this repo locally:

git clone git@github.com:sacha-c/VectorDrawable2Svg.git
git remote add upstream git@github.com:RohanTalip/VectorDrawable2Svg.git

To keep in sync:

git fetch upstream
git switch master
git merge upstream/master
git push -u origin master

To tag:

git tag vA.B.C
git push origin vA.B.C

Introduction

The VectorDrawable2Svg.py Python script converts Android VectorDrawable .xml files to .svg files.

This repository was forked from https://gitlab.com/Hyperion777/VectorDrawable2Svg to add handling of indirect colour references (e.g. in color.xml files) since that repository did not seem to be actively maintained (based on the unaddressed issues and merge/pull requests there at the time).

Usage

python3 VectorDrawable2Svg.py a.xml b.xml ...
./VectorDrawable2Svg.py --color-xml-file=path/to/color.xml a.xml b.xml ...
/path/to/VectorDrawable2Svg.py --viewbox-only a.xml b.xml ...

The output .svg files are written in the same directory as the .xml files (currently by simply replacing .xml with .svg in the filename).

Improvements

This Python script only supports some Android VectorDrawable attributes.

Suggestions (or merge requests) for improvement are welcome.

See also