Debian Codegraph @

third_party/rust/svg_fmt/README.md

raw
1 # svg_fmt
2
3 A set of simple types using `Display` formatters `{}` to easily write in the SVG format.
4 This can be useful to dump information in a visual way when debugging.
5
6 The crate is very small (and has no dependency).
7
8 ## Example
9
10 ```rust
11 use svg_fmt::*;
12
13 println!("{}", BeginSvg { w: 800.0, h: 600.0 });
14 println!(" {}",
15 rectangle(20.0, 50.0, 200.0, 100.0)
16 .fill(Fill::Color(red()))
17 .stroke(Stroke::Color(black(), 3.0))
18 .border_radius(5.0)
19 );
20 println!(" {}",
21 text(25.0, 100.0, "Hi!")
22 .size(42.0)
23 .color(white())
24 );
25 println!("{}", EndSvg);
26
27 ```
28