#svg-graphics #svg #graphics #2d-graphics

svg_fmt

Very simple debugging utilities to dump shapes in SVG format

10 releases

new 0.4.5 Apr 17, 2025
0.4.4 Nov 1, 2024
0.4.3 May 15, 2024
0.4.2 Mar 6, 2024
0.4.1 Jun 9, 2019

#138 in Graphics APIs

Download history 37286/week @ 2025-01-01 45095/week @ 2025-01-08 47446/week @ 2025-01-15 43822/week @ 2025-01-22 44461/week @ 2025-01-29 54237/week @ 2025-02-05 40227/week @ 2025-02-12 48107/week @ 2025-02-19 48441/week @ 2025-02-26 49827/week @ 2025-03-05 49030/week @ 2025-03-12 47617/week @ 2025-03-19 42860/week @ 2025-03-26 44099/week @ 2025-04-02 46873/week @ 2025-04-09 35285/week @ 2025-04-16

176,609 downloads per month
Used in 687 crates (6 directly)

MIT/Apache

21KB
725 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