{"id":30592978,"url":"https://github.com/embedded-graphics/embedded-text","last_synced_at":"2025-08-29T18:04:08.184Z","repository":{"id":47232131,"uuid":"280691668","full_name":"embedded-graphics/embedded-text","owner":"embedded-graphics","description":"Multiline TextBox for the embedded-graphics Rust crate","archived":false,"fork":false,"pushed_at":"2025-02-22T07:01:22.000Z","size":1455,"stargazers_count":64,"open_issues_count":8,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-28T10:55:16.414Z","etag":null,"topics":["embedded-graphics","textview"],"latest_commit_sha":null,"homepage":"","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/embedded-graphics.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-07-18T16:09:26.000Z","updated_at":"2025-05-28T03:00:40.000Z","dependencies_parsed_at":"2022-08-26T23:10:14.923Z","dependency_job_id":"9f40030a-ae6d-4784-b26e-26482d384292","html_url":"https://github.com/embedded-graphics/embedded-text","commit_stats":{"total_commits":657,"total_committers":4,"mean_commits":164.25,"dds":0.015220700152207,"last_synced_commit":"722d4f61920802a0c0ed4b2d8d6ccf4d2ff3809d"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/embedded-graphics/embedded-text","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fembedded-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fembedded-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fembedded-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fembedded-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embedded-graphics","download_url":"https://codeload.github.com/embedded-graphics/embedded-text/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embedded-graphics%2Fembedded-text/sbom","scorecard":{"id":374676,"data":{"date":"2025-08-11","repo":{"name":"github.com/embedded-graphics/embedded-text","commit":"d7644ef666e127ca254c72506d6796661cff9473"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Code-Review","score":4,"reason":"Found 4/9 approved changesets -- score normalized to 4","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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/rust.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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rust.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/embedded-text/rust.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rust.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/embedded-text/rust.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rust.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/embedded-text/rust.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rust.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/embedded-text/rust.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rust.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/embedded-text/rust.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rust.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/embedded-text/rust.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rust.yml:127: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/embedded-text/rust.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rust.yml:129: update your workflow using https://app.stepsecurity.io/secureworkflow/embedded-graphics/embedded-text/rust.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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 26 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:58.654Z","repository_id":47232131,"created_at":"2025-08-18T13:57:58.654Z","updated_at":"2025-08-18T13:57:58.654Z"},"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","textview"],"created_at":"2025-08-29T18:03:28.925Z","updated_at":"2025-08-29T18:04:08.176Z","avatar_url":"https://github.com/embedded-graphics.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# embedded-text [![crates.io](https://img.shields.io/crates/v/embedded_text.svg)](https://crates.io/crates/embedded_text) [![docs.rs](https://docs.rs/embedded-text/badge.svg)](https://docs.rs/embedded-text/) ![Rust](https://github.com/embedded-graphics/embedded-text/workflows/Rust/badge.svg)\n\nTextBox for embedded-graphics.\n\nThis crate provides a configurable `TextBox` to render multiline text inside a bounding\n`Rectangle` using [embedded-graphics].\n\n`TextBox` supports the common text alignments:\n - Horizontal:\n     - `Left`\n     - `Right`\n     - `Center`\n     - `Justified`\n - Vertical:\n     - `Top`\n     - `Middle`\n     - `Bottom`\n\n`TextBox` also supports some special characters not handled by embedded-graphics' `Text`:\n - non-breaking space (`\\u{200b}`)\n - zero-width space (`\\u{a0}`)\n - soft hyphen (`\\u{ad}`)\n - carriage return (`\\r`)\n - tab (`\\t`) with configurable tab size\n\n`TextBox` also supports text coloring using [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) via the `Ansi` plugin.\n\n### Example\n\nThe examples are based on [the embedded-graphics simulator]. The simulator is built on top of\n`SDL2`. See the [simulator README] for more information.\n\n![embedded-text example](https://raw.githubusercontent.com/embedded-graphics/embedded-text/master/assets/paragraph_spacing.png)\n\n![embedded-text example with colored text](https://raw.githubusercontent.com/embedded-graphics/embedded-text/master/assets/plugin-ansi.png)\n\n```rust\nuse embedded_graphics::{\n    mono_font::{ascii::FONT_6X10, MonoTextStyle},\n    pixelcolor::BinaryColor,\n    prelude::*,\n    primitives::Rectangle,\n};\nuse embedded_graphics_simulator::{\n    BinaryColorTheme, OutputSettingsBuilder, SimulatorDisplay, Window,\n};\nuse embedded_text::{\n    alignment::HorizontalAlignment,\n    style::{HeightMode, TextBoxStyleBuilder},\n    TextBox,\n};\n\nfn main() {\n    let text = \"Hello, World!\\n\\\n    A paragraph is a number of lines that end with a manual newline. Paragraph spacing is the \\\n    number of pixels between two paragraphs.\\n\\\n    Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when \\\n    an unknown printer took a galley of type and scrambled it to make a type specimen book.\";\n\n    // Specify the styling options:\n    // * Use the 6x10 MonoFont from embedded-graphics.\n    // * Draw the text fully justified.\n    // * Use `FitToText` height mode to stretch the text box to the exact height of the text.\n    // * Draw the text with `BinaryColor::On`, which will be displayed as light blue.\n    let character_style = MonoTextStyle::new(\u0026FONT_6X10, BinaryColor::On);\n    let textbox_style = TextBoxStyleBuilder::new()\n        .height_mode(HeightMode::FitToText)\n        .alignment(HorizontalAlignment::Justified)\n        .paragraph_spacing(6)\n        .build();\n\n    // Specify the bounding box. Note the 0px height. The `FitToText` height mode will\n    // measure and adjust the height of the text box in `into_styled()`.\n    let bounds = Rectangle::new(Point::zero(), Size::new(128, 0));\n\n    // Create the text box and apply styling options.\n    let text_box = TextBox::with_textbox_style(text, bounds, character_style, textbox_style);\n\n    // Create a simulated display with the dimensions of the text box.\n    let mut display = SimulatorDisplay::new(text_box.bounding_box().size);\n\n    // Draw the text box.\n    text_box.draw(\u0026mut display).unwrap();\n\n    // Set up the window and show the display's contents.\n    let output_settings = OutputSettingsBuilder::new()\n        .theme(BinaryColorTheme::OledBlue)\n        .scale(2)\n        .build();\n    Window::new(\"TextBox example with paragraph spacing\", \u0026output_settings).show_static(\u0026display);\n}\n```\n\n## Cargo features\n\n * `plugin` (*experimental*): allows implementing custom plugins.\n * `ansi`: enables ANSI sequence support using the `Ansi` plugin.\n\n[embedded-graphics]: https://github.com/embedded-graphics/embedded-graphics/\n[the embedded-graphics simulator]: https://github.com/embedded-graphics/embedded-graphics/tree/master/simulator\n[simulator README]: https://github.com/embedded-graphics/embedded-graphics/tree/master/simulator#usage-without-sdl2\n\n## Development setup\n\n### Minimum supported Rust version\nThe minimum supported Rust version for embedded-text is 1.61.0 or greater. Ensure you have the latest stable version of Rust installed, preferably through https://rustup.rs.\n\n### Installation\n\nFor setup in general, follow the installation instructions for [embedded-graphics].\n\nTo install SDL2 on Windows, see https://github.com/Rust-SDL2/rust-sdl2#windows-msvc\n\n## Attribution\n\nThe last paragraph of the example text is copied from https://www.lipsum.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembedded-graphics%2Fembedded-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembedded-graphics%2Fembedded-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembedded-graphics%2Fembedded-text/lists"}