{"id":30429550,"url":"https://github.com/embedded-graphics/eg-seven-segment","last_synced_at":"2025-08-22T17:20:02.048Z","repository":{"id":42709742,"uuid":"318847946","full_name":"embedded-graphics/eg-seven-segment","owner":"embedded-graphics","description":"Seven segment font for embedded-graphics","archived":false,"fork":false,"pushed_at":"2023-09-28T15:43:21.000Z","size":42,"stargazers_count":8,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-13T21:44:08.502Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/embedded-graphics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-05T17:28:02.000Z","updated_at":"2025-06-19T08:38:59.000Z","dependencies_parsed_at":"2022-08-30T11:41:07.035Z","dependency_job_id":null,"html_url":"https://github.com/embedded-graphics/eg-seven-segment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/embedded-graphics/eg-seven-segment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Feg-seven-segment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Feg-seven-segment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Feg-seven-segment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Feg-seven-segment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embedded-graphics","download_url":"https://codeload.github.com/embedded-graphics/eg-seven-segment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Feg-seven-segment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271528631,"owners_count":24775881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-22T17:19:57.875Z","updated_at":"2025-08-22T17:20:02.042Z","avatar_url":"https://github.com/embedded-graphics.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eg-seven-segment\n\n\n[![CI](https://github.com/embedded-graphics/eg-seven-segment/actions/workflows/rust.yml/badge.svg)](https://github.com/embedded-graphics/eg-seven-segment/actions/workflows/rust.yml)\n[![Crates.io](https://img.shields.io/crates/v/eg-seven-segment.svg)](https://crates.io/crates/eg-seven-segment)\n[![Docs.rs](https://docs.rs/eg-seven-segment/badge.svg)](https://docs.rs/eg-seven-segment)\n[![embedded-graphics on Matrix](https://img.shields.io/matrix/rust-embedded-graphics:matrix.org)](https://matrix.to/#/#rust-embedded-graphics:matrix.org)\n\n`eg-seven-segment` is a seven-segment display text renderer for use with\n[`embedded-graphics`]. It can be used to display virtual seven-segment displays\non any [`embedded-graphics`] [`DrawTarget`]. The appearance of the drawn digits\ncan be configured to achieve a wide variety of styles.\n\n![eg-seven-segment example][img1]\n\n## Examples\n\nThe most convenient way to use this crate is by using the [`SevenSegmentStyle`] as a\ncharacter style for an [`embedded-graphics`] [`Text`]:\n\n```rust\nuse embedded_graphics::{prelude::*, text::Text, pixelcolor::Rgb888};\nuse eg_seven_segment::SevenSegmentStyleBuilder;\n\n// Define a new style.\nlet style = SevenSegmentStyleBuilder::new()\n    .digit_size(Size::new(10, 20)) // digits are 10x20 pixels\n    .digit_spacing(5)              // 5px spacing between digits\n    .segment_width(5)              // 5px wide segments\n    .segment_color(Rgb888::GREEN)  // active segments are green\n    .build();\n\n// Use the style to draw text to a embedded-graphics `DrawTarget`.\nText::new(\"12:42\", Point::new(5, 25), style).draw(\u0026mut display)?;\n```\n\nIndividual digits can also be drawn by using the [`Digit`] drawable:\n\n```rust\nuse embedded_graphics::{prelude::*, text::Text, pixelcolor::Rgb888};\nuse eg_seven_segment::{SevenSegmentStyleBuilder, Digit, Segments};\n\n// Define a new style.\nlet style = SevenSegmentStyleBuilder::new()\n    .digit_size(Size::new(10, 20)) // digits are 10x20 pixels\n    .digit_spacing(5)              // 5px spacing between digits\n    .segment_width(5)              // 5px wide segments\n    .segment_color(Rgb888::GREEN)  // active segments are green\n    .build();\n\n// Draw digit with active segment A at the origin.\nlet next = Digit::new(Segments::A, Point::zero())\n    .into_styled(style)\n    .draw(\u0026mut display)?;\n\n// Draw `0` digit the the right of the previous digit.\nDigit::new('0'.try_into().unwrap(), next)\n    .into_styled(style)\n    .draw(\u0026mut display)?;\n```\n\n[`embedded-graphics`]: https://docs.rs/embedded-graphics\n[`Text`]: https://docs.rs/embedded-graphics/latest/embeddded_graphics/text/struct.Text.html\n[`DrawTarget`]: https://docs.rs/embedded-graphics/latest/embeddded_graphics/draw_target/struct.DrawTarget.html\n[`SevenSegmentStyle`]: https://docs.rs/eg-seven-segment/latest/eg_seven_segment/struct.SevenSegmentStyle.html\n[`Digit`]: https://docs.rs/eg-seven-segment/latest/eg_seven_segment/struct.Digit.html\n[img1]: assets/styles.png\n\n[`embedded-graphics`]: embedded_graphics\n[`Text`]: embedded_graphics::text::Text\n[`DrawTarget`]: embedded_graphics::draw_target::DrawTarget\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n  http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the\nwork by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembedded-graphics%2Feg-seven-segment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembedded-graphics%2Feg-seven-segment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembedded-graphics%2Feg-seven-segment/lists"}