{"id":15018030,"url":"https://github.com/blaind/bevy_text_mesh","last_synced_at":"2025-04-13T06:36:25.020Z","repository":{"id":42029666,"uuid":"391066685","full_name":"blaind/bevy_text_mesh","owner":"blaind","description":"A bevy 3D text mesh generator for displaying text","archived":false,"fork":false,"pushed_at":"2024-03-24T12:11:53.000Z","size":2556,"stargazers_count":66,"open_issues_count":15,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-26T23:05:28.318Z","etag":null,"topics":["bevy","glyphs","rust","tessellation","ttf"],"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/blaind.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":"2021-07-30T13:02:13.000Z","updated_at":"2025-01-26T23:08:43.000Z","dependencies_parsed_at":"2025-02-18T21:10:59.228Z","dependency_job_id":"74e91c56-28df-4369-bfea-0fb2f9b56630","html_url":"https://github.com/blaind/bevy_text_mesh","commit_stats":{"total_commits":27,"total_committers":3,"mean_commits":9.0,"dds":0.07407407407407407,"last_synced_commit":"f3d18c0512c2de793dc9d90598bba9f34b236cc4"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaind%2Fbevy_text_mesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaind%2Fbevy_text_mesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaind%2Fbevy_text_mesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaind%2Fbevy_text_mesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blaind","download_url":"https://codeload.github.com/blaind/bevy_text_mesh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675302,"owners_count":21143763,"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","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":["bevy","glyphs","rust","tessellation","ttf"],"created_at":"2024-09-24T19:51:20.372Z","updated_at":"2025-04-13T06:36:24.996Z","avatar_url":"https://github.com/blaind.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bevy_text_mesh \u0026emsp; [![Build Status]][actions] [![Latest Version]][crates.io] [![Docs Version]][docs]\n\n[build status]: https://img.shields.io/github/actions/workflow/status/blaind/bevy_text_mesh/ci.yml?branch=main\n[actions]: https://github.com/blaind/bevy_text_mesh/actions?query=branch%3Amain\n[latest version]: https://img.shields.io/crates/v/bevy_text_mesh.svg\n[crates.io]: https://crates.io/crates/bevy_text_mesh\n[docs version]: https://docs.rs/bevy_text_mesh/badge.svg\n[docs]: https://docs.rs/bevy_text_mesh\n\nA bevy 3D text mesh generator plugin for displaying text in 3D scenes\n\n![Example](docs/highlight.webp)\n\nThe text mesh is generated at runtime from runtime-tessellated (and cached) TrueType font glyphs. Tessellation of glyphs is done with C-based [github.com/fetisov/ttf2mesh](https://github.com/fetisov/ttf2mesh/) library that is being interfaced through Rust-based FFI API (see [ttf2glyph-rs](https://crates.io/crates/ttf2mesh)).\n\n## Known limitations\n\nConsider this as a preview of the plugin for gathering feedback about the API:\n\n- **The API will change in future - still iterating**\n- Multiple `TextMesh` configuration fields are not implemented yet, see example below\n- Text color update is not implemented yet\n- Spacing of characters are incorrect\n- Mesh cache purging is not implemented - this implementation will leak memory (see [#2](https://github.com/blaind/bevy_text_mesh/issues/2))\n- WASM builds are not supported (see [#11](https://github.com/blaind/bevy_text_mesh/issues/11))\n\n## Bevy versions support table\n\n| bevy | bevy_text_mesh |\n| ---- | -------------- |\n| 0.12 | 0.9.0          |\n| 0.11 | 0.7.0          |\n| 0.10 | 0.6.0          |\n| 0.9  | 0.5.0          |\n| 0.8  | 0.4.0          |\n| 0.7  | 0.2.0          |\n| 0.6  | 0.1.0          |\n| 0.5  | 0.0.2          |\n\n## Usage\n\n## Prequisites\n\nPrequisites (for compiling [ttf2mesh-rs](https://crates.io/crates/ttf2mesh)):\n\n    apt-get install build-essential patch\n\n## Running the examples\n\nSee the [examples](/examples) -folder.\n\n```\ngit clone https://github.com/blaind/bevy_text_mesh.git\ncd bevy_text_mesh\ncargo run --example 3d_scene --release # or\ncargo run --example performance --release\n```\n\n## Integrating to your Bevy App\n\nAdd to Cargo.toml:\n\n```\n[dependencies]\nbevy_text_mesh = \"0.9.0\"\n```\n\nInclude the library:\n\n```rust\nuse bevy_text_mesh::prelude::*;\n```\n\nSecond, add a `TextMeshPlugin` to your app:\n\n```rust\nApp::new()\n    ...\n    .add_plugins(TextMeshPlugin)\n    ...;\n```\n\nThen, add the desired TrueType-fonts (with suffix `.ttf`) into your assets folder, a good convention is to store them to `assets/fonts` folder.\n\nFor example, see Fira fonts. Please read also their [LICENSE](https://github.com/mozilla/Fira/blob/master/LICENSE).\n\n    mkdir -p assets/fonts\n    wget https://github.com/mozilla/Fira/raw/master/ttf/FiraSans-Medium.ttf -O assets/fonts/FiraSans-Medium.ttf\n\nNext, you are ready to spawn a text in your scene at a system:\n\nFirst, load a font asset:\n\n```rust\nlet font: Handle\u003cTextMeshFont\u003e = asset_server.load(\"fonts/FiraSans-Medium.ttf#mesh\");\n```\n\nThen, spawn a textmesh bundle:\n\n```rust\ncommands.spawn(TextMeshBundle {\n    text_mesh: TextMesh::new_with_color(\"Hello Bevy\", font, Color::rgb(1., 1., 0.)),\n    transform: Transform::from_xyz(-1., 1.75, 0.),\n    ..Default::default()\n});\n```\n\nOr with expanded syntax:\n\n```rust\ncommands.spawn(TextMeshBundle {\n    text_mesh: TextMesh {\n        text: String::from(\"Hello Bevy!\"),\n        style: TextMeshStyle {\n            font,\n            font_size: SizeUnit::NonStandard(36.),\n            color: Color::rgb(1.0, 1.0, 0.0),\n            font_style: FontStyle::UPPERCASE, // only UPPERCASE \u0026 LOWERCASE implemented currently\n            mesh_quality: Quality::Low,\n            ..Default::default()\n        },\n        alignment: TextMeshAlignment {\n            vertical: VerticalAlign::Top, // FUNCTIONALITY NOT IMPLEMENTED YET - NO EFFECT\n            horizontal: HorizontalAlign::Left, // FUNCTIONALITY NOT IMPLEMENTED YET - NO EFFECT\n            ..Default::default()\n        },\n        size: TextMeshSize {\n            width: SizeUnit::NonStandard(135.),       // partially implemented\n            height: SizeUnit::NonStandard(50.),       // partially implemented\n            depth: Some(SizeUnit::NonStandard(50.0)), // must be \u003e 0 currently, 2d mesh not supported yet\n            wrapping: true,                           // partially implemented\n            overflow: false,                          // NOT IMPLEMENTED YET\n            ..Default::default()\n        },\n        ..Default::default()\n    },\n    transform: Transform {\n        translation: Vec3::new(-1., 1.75, 0.),\n        ..Default::default()\n    },\n    ..Default::default()\n});\n```\n\n## License\n\nLicensed under \u003ca href=\"LICENSE\"\u003eMIT license\u003c/a\u003e\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the software by you, shall be licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaind%2Fbevy_text_mesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblaind%2Fbevy_text_mesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaind%2Fbevy_text_mesh/lists"}