Skip to content
/ svg Public

An svg creation crate stripped down for usage in a Radix blueprint

License

Notifications You must be signed in to change notification settings

yr12345678/svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note: this repo has a very specific purpose

This repo contains a modified version of https://github.com/bodoni/svg that removes any floats and the parser. Its intended use is for building SVGs in a Radix (radixdlt.com) blueprint where floats are not allowed and the parser is not required.


The package provides an SVG composer and parser.

Example: Composing

use svg::Document;
use svg::node::element::Path;
use svg::node::element::path::Data;

let data = Data::new()
    .move_to((10, 10))
    .line_by((0, 50))
    .line_by((50, 0))
    .line_by((0, -50))
    .close();

let path = Path::new()
    .set("fill", "none")
    .set("stroke", "black")
    .set("stroke-width", 3)
    .set("d", data);

let document = Document::new()
    .set("viewBox", (0, 0, 70, 70))
    .add(path);

svg::save("image.svg", &document).unwrap();

About

An svg creation crate stripped down for usage in a Radix blueprint

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages