{"id":30592981,"url":"https://github.com/embedded-graphics/simulator","last_synced_at":"2025-08-29T18:04:10.975Z","repository":{"id":41185457,"uuid":"309634760","full_name":"embedded-graphics/simulator","owner":"embedded-graphics","description":"Desktop simulator for embedded-graphics","archived":false,"fork":false,"pushed_at":"2025-06-08T20:08:42.000Z","size":145,"stargazers_count":107,"open_issues_count":7,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-24T19:49:08.354Z","etag":null,"topics":["embedded-graphics","simulator"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/embedded-graphics-simulator","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":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"jamwaffles","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-11-03T09:25:02.000Z","updated_at":"2025-08-24T05:31:36.000Z","dependencies_parsed_at":"2023-11-09T11:05:46.192Z","dependency_job_id":"18db6430-c9c4-414e-aff9-af65dfae8f3a","html_url":"https://github.com/embedded-graphics/simulator","commit_stats":{"total_commits":42,"total_committers":5,"mean_commits":8.4,"dds":0.5,"last_synced_commit":"829a67cf395db825e3732b6a61389fc4187b3563"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/embedded-graphics/simulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fsimulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fsimulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fsimulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fsimulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embedded-graphics","download_url":"https://codeload.github.com/embedded-graphics/simulator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fsimulator/sbom","scorecard":{"id":374677,"data":{"date":"2025-08-11","repo":{"name":"github.com/embedded-graphics/simulator","commit":"eb74a10a717213681400229374dd831818c51b03"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"checks":[{"name":"Code-Review","score":5,"reason":"Found 17/30 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":4,"reason":"3 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/simulator/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/simulator/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/simulator/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/simulator/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/simulator/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/simulator/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/simulator/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/simulator/ci.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   5 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T13:57:59.074Z","repository_id":41185457,"created_at":"2025-08-18T13:57:59.075Z","updated_at":"2025-08-18T13:57:59.075Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272734612,"owners_count":24984277,"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-29T02:00:10.610Z","response_time":87,"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":["embedded-graphics","simulator"],"created_at":"2025-08-29T18:03:34.123Z","updated_at":"2025-08-29T18:04:10.961Z","avatar_url":"https://github.com/embedded-graphics.png","language":"Rust","funding_links":["https://github.com/sponsors/jamwaffles"],"categories":[],"sub_categories":[],"readme":"# Embedded graphics simulator\n\n[![Build Status](https://circleci.com/gh/embedded-graphics/simulator/tree/master.svg?style=shield)](https://circleci.com/gh/embedded-graphics/simulator/tree/master)\n[![Crates.io](https://img.shields.io/crates/v/embedded-graphics-simulator.svg)](https://crates.io/crates/embedded-graphics-simulator)\n[![Docs.rs](https://docs.rs/embedded-graphics-simulator/badge.svg)](https://docs.rs/embedded-graphics-simulator)\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## [Documentation](https://docs.rs/embedded-graphics-simulator)\n\n![It can display all sorts of embedded-graphics test code.](https://raw.githubusercontent.com/embedded-graphics/embedded-graphics/master/assets/simulator-demo.png)\n\nThe simulator can be used to test and debug\n[embedded-graphics](https://crates.io/crates/embedded-graphics) code, or produce examples and\ninteractive demos to show off embedded graphics features.\n\n## [Examples](https://github.com/embedded-graphics/examples)\n\nMore simulator examples can be found in the [examples repository](https://github.com/embedded-graphics/examples).\n\n### Simulate a 128x64 SSD1306 OLED\n\n```rust\nuse embedded_graphics::{\n    pixelcolor::BinaryColor,\n    prelude::*,\n    primitives::{Circle, Line, Rectangle, PrimitiveStyle},\n    mono_font::{ascii::FONT_6X9, MonoTextStyle},\n    text::Text,\n};\nuse embedded_graphics_simulator::{BinaryColorTheme, SimulatorDisplay, Window, OutputSettingsBuilder};\n\nfn main() -\u003e Result\u003c(), core::convert::Infallible\u003e {\n    let mut display = SimulatorDisplay::\u003cBinaryColor\u003e::new(Size::new(128, 64));\n\n    let line_style = PrimitiveStyle::with_stroke(BinaryColor::On, 1);\n    let text_style = MonoTextStyle::new(\u0026FONT_6X9, BinaryColor::On);\n\n    Circle::new(Point::new(72, 8), 48)\n        .into_styled(line_style)\n        .draw(\u0026mut display)?;\n\n    Line::new(Point::new(48, 16), Point::new(8, 16))\n        .into_styled(line_style)\n        .draw(\u0026mut display)?;\n\n    Line::new(Point::new(48, 16), Point::new(64, 32))\n        .into_styled(line_style)\n        .draw(\u0026mut display)?;\n\n    Rectangle::new(Point::new(79, 15), Size::new(34, 34))\n        .into_styled(line_style)\n        .draw(\u0026mut display)?;\n\n    Text::new(\"Hello World!\", Point::new(5, 5), text_style).draw(\u0026mut display)?;\n\n    let output_settings = OutputSettingsBuilder::new()\n        .theme(BinaryColorTheme::OledBlue)\n        .build();\n    Window::new(\"Hello World\", \u0026output_settings).show_static(\u0026display);\n\n    Ok(())\n}\n```\n\n## Setup\n\nThe simulator uses SDL2 and its development libraries which must be installed to build and run\nit.\n\n### Linux (`apt`)\n\n```bash\nsudo apt install libsdl2-dev\n```\n\n### macOS (`brew`)\n\n```bash\nbrew install sdl2\n```\n\nUsers on Apple silicon or with custom installation directories will need to\nset `LIBRARY_PATH` for the linker to find the installed SDL2 package:\n\n```bash\nexport LIBRARY_PATH=\"$LIBRARY_PATH:$(brew --prefix)/lib\"\n```\nMore information can be found in the\n[SDL2 documentation](https://github.com/Rust-SDL2/rust-sdl2#homebrew).\n\n### Windows\n\nThe Windows install process is a bit more involved, but it _does_ work. See [the Rust-SDL2\ncrate's README](https://github.com/Rust-SDL2/rust-sdl2) for instructions. There are multiple\nways to get it working, but probably the simplest method is copying the binaries as shown\n[here](https://github.com/Rust-SDL2/rust-sdl2#windows-msvc).\n\n## Creating screenshots\n\nScreenshots of programs, that use `Window` to display a simulated display, can be created by\nsetting the `EG_SIMULATOR_DUMP` or `EG_SIMULATOR_DUMP_RAW` environment variable:\n\n```bash\nEG_SIMULATOR_DUMP=screenshot.png cargo run\n```\n\nBy setting the variable the display passed to the first `Window::update` call gets exported as\na PNG file to the specified path. After the file is exported the process is terminated.\n\nThe difference between `EG_SIMULATOR_DUMP` and `EG_SIMULATOR_DUMP_RAW` is that the first method\napplies the output settings before exporting the PNG file and the later dumps the unaltered\ndisplay content.\n\n## Exporting images\n\nIf a program doesn't require to display a window and only needs to export one or more images, a\n`SimulatorDisplay` can also be converted to an `image` crate\n`ImageBuffer` by using the `to_rgb_output_image` or `to_grayscale_output_image` methods.\nThe resulting buffer can then be used to save the display content to any format supported by\n`image`.\n\n## Using the simulator in CI\n\nThe simulator supports two environment variables to check if the display content matches a\nreference PNG file: `EG_SIMULATOR_CHECK` and `EG_SIMULATOR_CHECK_RAW`. If the display content\nof the first `Window::update` call doesn't match the reference image the process exits with a\nnon zero exit exit code. Otherwise the process will exit with a zero exit code.\n\n```bash\nEG_SIMULATOR_CHECK=screenshot.png cargo run || echo \"Display doesn't match PNG file\"\n```\n\n`EG_SIMULATOR_CHECK` assumes that the reference image was created using the same\n`OutputSetting`s, while `EG_SIMULATOR_CHECK_RAW` assumes an unstyled reference image.\n\n## Usage without SDL2\n\nWhen the simulator is used in headless/CI environments that don't require showing a window, SDL2\nsupport can be disabled. This removes the requirement of SDL2 being installed on the target machine,\nbut still allows the simulator to be used to generate images.\n\nThe `with-sdl` feature is enabled by default and can be disabled by adding `default-features = false` to the dependency:\n\n```toml\n[dependencies.embedded-graphics-simulator]\nversion = \"0.2.0\"\ndefault-features = false\n```\n\nSee the [Choosing\nFeatures](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#choosing-features)\nCargo manifest documentation for more details.\n\n\n## Minimum supported Rust version\n\nThe `embedded-graphics-simulator` crate is tested to compile on the latest stable Rust release.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or 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%2Fsimulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembedded-graphics%2Fsimulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembedded-graphics%2Fsimulator/lists"}