gecko-dev/third_party/rust/svg_fmt
Nicolas Silva 0a6cdf56e5 Bug 1547290 - Vendoring changes. r=kvark"
Differential Revision: https://phabricator.services.mozilla.com/D29004

--HG--
extra : source : aa8a0a8b3440b1369cfb948633b760835cbbef0c
2019-04-29 17:06:41 +02:00
..
src
.cargo-checksum.json
Cargo.toml
README.md

README.md

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);