Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
macro
pietify
src
.gitignore
Cargo.lock
Cargo.toml
README.md
test.svg
test2.svg

README.md

svg-to-piet

This is a simple utility to help convert an SVG into piet draw instructions. Mostly for the sake of rapid UI prototyping in druid.

Macro usage

The macro imports the SVG at compile time and turns into a function you can call at runtime by passing a paint_ctx. The x and y are the origin you want to paint at (f64 btw).

use svg_to_piet::*;

#[derive(SvgToPiet)]
#[file = "test.svg"]
struct TrashCan;

TrashCan::draw(paint_ctx, x, y);

Command line usage

Outputs a list of draw instructions to the command line so you can copy and paste them wherever you'd like.

cargo run test.svg
You can’t perform that action at this time.