✨ SVG to Cairo Code Converter
SVGenerator is a tool to convert SVG files to Cairo code that outputs the SVG file.
SVG groups <g id="group1"> .. </g>
will produce a specific Cairo function
fn print_group1(ref svg, data: @Data) { .. }
The SVG can be annotated with @@var_name@@
to allow data to be added dynamically in Cairo.
To build the project, run:
cargo build
To convert a (annotated) SVG file to Cairo:
cargo run --generate path/to/yourfile.svg
To escape quotation marks ".."
cargo run -- generate path/to/yourfile.svg --escaped
cargo run -- generate path/to/yourfile.svg -e
To visualize the SVG grouping structure:
cargo run -- groups path/to/yourfile.svg
This project is licensed under the APACHE 2 license. See LICENSE for more information.