#2d #graphics #svg

svg_fmt

Very simple debugging utilities to dump shapes in SVG format

6 releases (3 breaking)

0.4.1 Jun 9, 2019
0.4.0 Apr 29, 2019
0.3.0 Apr 26, 2019
0.2.1 Apr 25, 2019
0.1.0 Apr 25, 2019

#903 in Graphics APIs

Download history 15849/week @ 2023-02-08 19050/week @ 2023-02-15 17437/week @ 2023-02-22 18356/week @ 2023-03-01 17650/week @ 2023-03-08 16093/week @ 2023-03-15 17273/week @ 2023-03-22 16355/week @ 2023-03-29 16918/week @ 2023-04-05 14862/week @ 2023-04-12 15348/week @ 2023-04-19 16451/week @ 2023-04-26 16046/week @ 2023-05-03 15991/week @ 2023-05-10 16595/week @ 2023-05-17 14400/week @ 2023-05-24

65,258 downloads per month
Used in 272 crates (5 directly)

MIT/Apache

17KB
563 lines

svg_fmt

A set of simple types using Display formatters {} to easily write in the SVG format. This can be useful to dump information in a visual way when debugging.

The crate is very small (and has no dependency).

Example

use svg_fmt::*;

println!("{}", BeginSvg { w: 800.0, h: 600.0 });
println!("    {}",
    rectangle(20.0, 50.0, 200.0, 100.0)
        .fill(Fill::Color(red()))
        .stroke(Stroke::Color(black(), 3.0))
        .border_radius(5.0)
);
println!("    {}",
    text(25.0, 100.0, "Hi!")
        .size(42.0)
        .color(white())
);
println!("{}", EndSvg);

No runtime deps