{"id":24689827,"url":"https://github.com/mintlu8/bevy_rich_text3d","last_synced_at":"2025-03-22T00:11:44.201Z","repository":{"id":271471759,"uuid":"913372717","full_name":"mintlu8/bevy_rich_text3d","owner":"mintlu8","description":"Mesh based bevy text implementation.","archived":false,"fork":false,"pushed_at":"2025-03-08T10:33:51.000Z","size":102,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-08T11:26:59.513Z","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/mintlu8.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-07T15:02:04.000Z","updated_at":"2025-03-08T10:33:55.000Z","dependencies_parsed_at":"2025-01-08T23:16:11.691Z","dependency_job_id":"f9f7c931-6a6e-471b-8c3f-24fa0e31a2f8","html_url":"https://github.com/mintlu8/bevy_rich_text3d","commit_stats":null,"previous_names":["mintlu8/bevy_rich_text3d"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fbevy_rich_text3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fbevy_rich_text3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fbevy_rich_text3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fbevy_rich_text3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mintlu8","download_url":"https://codeload.github.com/mintlu8/bevy_rich_text3d/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244885701,"owners_count":20526296,"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":[],"created_at":"2025-01-26T18:17:25.082Z","updated_at":"2025-03-22T00:11:44.188Z","avatar_url":"https://github.com/mintlu8.png","language":"Rust","funding_links":[],"categories":["Text"],"sub_categories":[],"readme":"# bevy_rich_text3d\n\n[![Crates.io](https://img.shields.io/crates/v/bevy_rich_text3d.svg)](https://crates.io/crates/bevy_rich_text3d)\n[![Docs](https://docs.rs/bevy_rich_text3d/badge.svg)](https://docs.rs/bevy_rich_text3d/latest/bevy_rich_text3d/)\n[![Bevy tracking](https://img.shields.io/badge/Bevy%20tracking-released%20version-lightblue)](https://bevyengine.org/learn/book/plugin-development/)\n\nMesh based raster rich text implementation for `bevy`.\n\n## Overview\n\nThis crate is similar to `bevy_text` but aims to be more user friendly and powerful.\n\nUnlike `bevy_text`, this crate renders text as a `Mesh` and an `Image` atlas. This not only works\nwith `StandardMaterial` but also can be empowered by user defined shaders.\n\nWe render each glyph as a separate quad, meaning in shaders, we can easily manipulate\nindividual glyphs for different effects. Additionally we support exporting specific values\nlike glyph count, glyph position or user defined magic numbers via the `uv1` field.\n\n## Getting Started\n\nAdd plugins:\n\n```rust, ignore\napp.add_plugins(Text3dPlugin{\n    default_atlas_dimension: (1024, 1024),\n    load_system_fonts: true,\n    load_font_directories: vec![\"assets/fonts\".to_owned()]\n    ..Default::default()\n})\n```\n\nSpawn a `Text3d`.\n\n```rust, ignore\ncommands.spawn(\n    Text3d::new(\"Hello, World!\"),\n    // Mesh2d also works\n    Mesh3d::default(),\n    MeshMaterial3d(materials.add(\n        StandardMaterial {\n            base_color_texture: Some(TextAtlas::DEFAULT_IMAGE.clone()),\n            alpha_mode: AlphaMode::Blend,\n            ..Default::default()\n        }\n    ))\n)\n```\n\n## Rich Text\n\nRich text can be created from a string using the `Text3d::parse` function. We support a\nsimple syntax like `{style:value}` which is equivalent to `\u003cstyle\u003evalue\u003c/style\u003e` in html,\nand `{value}`, which acts as a dynamic value that can be fetched from the world.\n\nSee documentation on `Text3d::parse` for up-to-date syntax.\n\n## Dependencies\n\n* `cosmic_text`\n\nCosmic text is used for layout.\n\n* `zeno`\n\nUsed for tesselation, this is the same render engine as `bevy_text`, `cosmic_text` and `swash`.\nWe use this crate directly since we do not use `swash`.\n\n* `bevy`\n\nBevy's asset system functions as an alternative to `swash`.\n\n## Glyph Atlas\n\nWe store rendered glyphs inside a texture atlas in the component `TextAtlasHandle`.\nIf you did not create a new one, all glyphs will be cached inside the same\ndefault texture, and you can use the convenient `TextAtlas::DEFAULT_IMAGE` as the image in your materials.\n\nHowever, if you need more control over where your glyphs are stored, you can manually\ncreate a `TextAtlas` and `Image` alongside your `Text3d`, they can be managed the same way\nas other assets.\n\n## FAQ\n\n* How do I add fonts?\n\nAdd them to the `LoadFonts` resource before the app starts.\n\n* Some characters are missing when text changes\n\nYou must add `TouchTextMaterial*dPlugin` to get around a change detection issue in bevy.\nThis is a band-aid solution intended to be removed later as we wait for a fix upstream.\n\n## Showcase\n\n![image1](./showcase/a.gif)\n![image2](./showcase/b.gif)\n![image3](./showcase/c.gif)\n![image4](./showcase/d.gif)\n\n## Versions\n\n| bevy | bevy_rich_text3d |\n|------|------------------|\n| 0.15 | 0.1-latest       |\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work 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%2Fmintlu8%2Fbevy_rich_text3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmintlu8%2Fbevy_rich_text3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmintlu8%2Fbevy_rich_text3d/lists"}