#badge #svg #binary #pure #included #generate #style

bin+lib badges

A pure Rust library for generating SVG badges with an included binary

3 releases

0.3.2 Nov 14, 2022
0.3.1 Nov 14, 2022
0.3.0 Nov 14, 2022

#269 in Visualization

39 downloads per month

MIT/Apache

400KB
400 lines

badges

A small library to render badges. Includes a binary for command line usage.

Example

use badges::{BadgeBuilder, BadgeColor, BadgeStyle};

let badge_svg = BadgeBuilder::new()
	.style(BadgeStyle::Flat)
	.label("badge")
	.message("rendered")
	.message_color(BadgeColor::Green)
	.render()
	.expect("failed to render badge");

Command Line Usage

Install with cargo install badges --features cli. Use with badges 'label' 'message' --label-color grey --message-color green > badge.svg.

License

Licensed under either of

at your option.

The included DejaVu Sans font is licensed as described here.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the fork by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2.4–3.5MB
~76K SLoC