eg-seven-segment
eg-seven-segment is a seven-segment display text renderer for use with
embedded-graphics. It can be used to display virtual seven-segment displays
on any embedded-graphics DrawTarget. The appearance of the drawn digits
can be configured to achieve a wide variety of styles.

Examples
The most convenient way to use this crate is by using the SevenSegmentStyle as a
character style for an embedded-graphics Text:
use ;
use SevenSegmentStyleBuilder;
// Define a new style.
let style = new
.digit_size // digits are 10x20 pixels
.digit_spacing // 5px spacing between digits
.segment_width // 5px wide segments
.segment_color // active segments are green
.build;
// Use the style to draw text to a embedded-graphics `DrawTarget`.
new.draw?;
Individual digits can also be drawn by using the Digit drawable:
use ;
use ;
// Define a new style.
let style = new
.digit_size // digits are 10x20 pixels
.digit_spacing // 5px spacing between digits
.segment_width // 5px wide segments
.segment_color // active segments are green
.build;
// Draw digit with active segment A at the origin.
let next = new
.into_styled
.draw?;
// Draw `0` digit the the right of the previous digit.
new
.into_styled
.draw?;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.