{"id":49590898,"url":"https://github.com/forjd/seg-lcd-rust","last_synced_at":"2026-05-10T07:01:06.238Z","repository":{"id":355500327,"uuid":"1228333108","full_name":"forjd/seg-lcd-rust","owner":"forjd","description":"A Rust seven-segment LCD simulator with terminal, SVG, and native GUI renderers.","archived":false,"fork":false,"pushed_at":"2026-05-05T20:21:55.000Z","size":127,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T04:40:01.482Z","etag":null,"topics":["egui","lcd","rust","seven-segment","simulator","svg"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forjd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-03T22:28:57.000Z","updated_at":"2026-05-05T20:21:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/forjd/seg-lcd-rust","commit_stats":null,"previous_names":["forjd/seg-lcd-rust"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/forjd/seg-lcd-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forjd%2Fseg-lcd-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forjd%2Fseg-lcd-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forjd%2Fseg-lcd-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forjd%2Fseg-lcd-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forjd","download_url":"https://codeload.github.com/forjd/seg-lcd-rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forjd%2Fseg-lcd-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32767591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["egui","lcd","rust","seven-segment","simulator","svg"],"created_at":"2026-05-04T01:00:25.168Z","updated_at":"2026-05-09T06:01:27.325Z","avatar_url":"https://github.com/forjd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# seg-lcd-rust\n\n[![CI](https://github.com/Forjd/seg-lcd-rust/actions/workflows/ci.yml/badge.svg)](https://github.com/Forjd/seg-lcd-rust/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nA Rust simulator for seven-segment LCD displays like the digits used in basic\ncalculators, digital clocks, and classic digital watches.\n\n![Seven-segment LCD preview](docs/assets/preview.svg)\n\nIt includes:\n\n- a terminal renderer\n- a browser-viewable SVG exporter\n- a native `egui` desktop GUI\n- WebAssembly bindings for browser demos\n- a shared library for parsing text, segment masks, themes, geometry, terminal\n  rendering, and SVG rendering\n\n## Status\n\nEarly development. The CLI, SVG exporter, and native GUI are usable, but the API\nis not yet stable.\n\n## Usage\n\n```bash\ncargo run -- 0123456789\ncargo run --bin seg-lcd-rust-gui\ncargo run -- --labels HELP\ncargo run -- --inverse 10:58.42\ncargo run -- 12:34.5 --masks\ncargo run -- --mask ABDEG --mask BCG --labels\ncargo run -- --svg display.svg 0123456789\ncargo run -- --svg amber.svg --theme amber 10:58.42\ncargo run -- --svg blue.svg --theme blue --glow 88:88.88\ncargo run -- --svg custom.svg --on 102418 --off 6b7a62 --bg dbe5d2 --panel c3d0ba --inactive-opacity 0.18 1234\n```\n\n`cargo run -- ...` runs the CLI by default. Use `cargo run --bin seg-lcd-rust-gui`\nfor the desktop app.\n\n## Install\n\nInstall the latest Linux or macOS release binaries with:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/Forjd/seg-lcd-rust/main/install.sh | sh\n```\n\nBy default this installs both binaries to `~/.local/bin`:\n\n- `seg-lcd-rust`\n- `seg-lcd-rust-gui`\n\nInstall to a custom directory:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/Forjd/seg-lcd-rust/main/install.sh | sh -s -- --dir /usr/local/bin\n```\n\nInstall a specific release:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/Forjd/seg-lcd-rust/main/install.sh | sh -s -- --version v0.3.0\n```\n\nWhen a release includes `SHA256SUMS.txt`, the install script verifies the\ndownloaded archive before installing.\n\nWindows binaries are available from GitHub Releases, but the install script is\ncurrently for Linux and macOS only.\n\nOn macOS, the GUI binary is not signed or notarized yet, so Gatekeeper may ask\nyou to approve it before first launch.\n\nUninstall:\n\n```bash\nrm ~/.local/bin/seg-lcd-rust ~/.local/bin/seg-lcd-rust-gui\n```\n\n## GUI\n\nRun the desktop GUI with:\n\n```bash\ncargo run --bin seg-lcd-rust-gui\n```\n\nThe GUI provides a live LCD preview, editable display text, theme selection,\ncolor controls, inactive-segment opacity, glow and glass toggles, and an SVG\nexport button that writes `gui-display.svg`.\n\n## WebAssembly\n\nBuild the Rust library as a browser-loadable Wasm package with:\n\n```bash\ncargo install wasm-pack\nwasm-pack build --target web --out-dir web/pkg\n```\n\nThen serve the static demo from the project root:\n\n```bash\npython3 -m http.server 8080\n```\n\nOpen \u003chttp://localhost:8080/web/\u003e. The demo calls the Rust SVG renderer through\nthe Wasm exports in `src/wasm.rs`, so browser output stays aligned with the CLI\nand GUI renderers.\n\n## Library\n\nThe shared library can parse display text and render terminal or SVG output:\n\n```rust\nuse seg_lcd_rust::{LcdStyle, TerminalStyle, render_svg, render_text};\n\nlet text = \"12:34.5\";\nlet terminal = render_text(text, TerminalStyle::default());\nlet svg = render_svg(text, LcdStyle::default());\n```\n\n## Structure\n\n- `src/lib.rs` contains the shared segment model, parser, themes, terminal\n  renderer, SVG renderer, and segment geometry.\n- `src/wasm.rs` exposes browser-facing WebAssembly bindings for SVG rendering.\n- `src/main.rs` is the CLI wrapper.\n- `src/bin/gui.rs` is the native `egui` desktop app.\n\n## Checks\n\n```bash\ncargo fmt --check\ncargo test\ncargo clippy --all-targets -- -D warnings\n```\n\n## Build Binaries\n\nBuild optimized local binaries with:\n\n```bash\ncargo build --release --bins\n```\n\nThe CLI binary is `target/release/seg-lcd-rust`. The GUI binary is\n`target/release/seg-lcd-rust-gui`.\n\n## Performance\n\nOn an Apple M4 Pro Mac running Rust 1.94.0, the release CLI completes typical\nsingle-render invocations in about 1.3-1.5 ms when benchmarked without shell\nstartup overhead:\n\n```bash\nhyperfine --shell=none --warmup 50 --runs 200 \\\n  './target/release/seg-lcd-rust 0123456789' \\\n  './target/release/seg-lcd-rust 0123456789:0123456789.0123456789' \\\n  './target/release/seg-lcd-rust --svg /tmp/seg-lcd-rust-bench.svg --theme amber 10:58.42'\n```\n\nThese short runs are mostly process-startup-bound; rendering longer display text\nadds little overhead.\n\n## Releases\n\nReleases are automated with Release Please from Conventional Commits. Changes\nmerged to `main` update a release PR; merging that PR creates the GitHub Release,\nupdates `CHANGELOG.md`, and bumps the crate version. When Release Please creates\na release, the binary workflow builds and attaches CLI/GUI archives for Linux,\nmacOS, and Windows, plus `SHA256SUMS.txt`.\n\nPull requests should use a Conventional Commit title such as `feat: add segment\neditor` or `fix(svg): preserve decimal points`.\n\n### Publishing A Release\n\n1. Merge feature and fix commits to `main` using Conventional Commit messages.\n2. Wait for Release Please to open or update its release PR.\n3. Review the generated version bump and `CHANGELOG.md` entries.\n4. Merge the Release Please PR.\n5. Confirm the release was created and the `Release Binaries` workflow passed.\n6. Check the GitHub Release for platform archives and `SHA256SUMS.txt`.\n\nThe release archives are smoke-tested in CI before upload by unpacking each\narchive, checking that both binaries are present, and running the CLI with\n`--help` and sample display text.\n\n## Options\n\n- `--labels` renders segment names (`A` through `G`) instead of filled cells.\n- `--inverse` renders active LCD segments as clear space against inactive blocks.\n- `--masks` prints each character's seven-bit segment mask.\n- `--mask \u003cvalue\u003e` renders a custom digit from segment letters such as `ABDEG`,\n  comma-separated segment letters such as `A,B,D,E,G`, binary bits such as\n  `0b1011011`, or hex bits such as `0x5b`. Repeat it to render multiple custom\n  digits.\n- `--svg \u003cpath\u003e` writes a browser-viewable SVG rendering with faint inactive\n  LCD segments.\n- `--theme \u003cname\u003e` applies an SVG theme: `classic`, `green`, `amber`, `blue`,\n  or `negative`.\n- `--on \u003chex\u003e`, `--off \u003chex\u003e`, `--bg \u003chex\u003e`, and `--panel \u003chex\u003e` override SVG\n  colors. Hex values can be written with or without `#`.\n- `--inactive-opacity \u003cnumber\u003e` controls how visible inactive SVG segments are,\n  from `0.0` to `1.0`.\n- `--glow`, `--no-glow`, and `--no-glass` toggle SVG display effects.\n\nSupported characters are digits, a small set of seven-segment-friendly letters,\nspace, `-`, `_`, `.`, and `:`.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforjd%2Fseg-lcd-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforjd%2Fseg-lcd-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforjd%2Fseg-lcd-rust/lists"}