{"id":13439562,"url":"https://github.com/redox-os/rusttype","last_synced_at":"2025-12-12T12:15:13.308Z","repository":{"id":47211428,"uuid":"51160541","full_name":"redox-os/rusttype","owner":"redox-os","description":"Mirror of https://gitlab.redox-os.org/redox-os/rusttype","archived":false,"fork":false,"pushed_at":"2024-02-07T21:58:54.000Z","size":18468,"stargazers_count":632,"open_issues_count":7,"forks_count":52,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-06-07T01:24:21.866Z","etag":null,"topics":["font","opentype","rust","truetype"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":false,"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/redox-os.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-02-05T16:59:21.000Z","updated_at":"2025-06-04T06:19:23.000Z","dependencies_parsed_at":"2024-10-27T23:11:30.193Z","dependency_job_id":"6c2d9b3b-4a61-4473-bf02-b690c0f7f31f","html_url":"https://github.com/redox-os/rusttype","commit_stats":null,"previous_names":["dylanede/rusttype"],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/redox-os/rusttype","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frusttype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frusttype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frusttype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frusttype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redox-os","download_url":"https://codeload.github.com/redox-os/rusttype/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frusttype/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261937039,"owners_count":23232846,"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":["font","opentype","rust","truetype"],"created_at":"2024-07-31T03:01:15.156Z","updated_at":"2025-12-12T12:15:08.265Z","avatar_url":"https://github.com/redox-os.png","language":"Rust","readme":"# RustType\n[![crates.io](https://img.shields.io/crates/v/rusttype.svg)](https://crates.io/crates/rusttype)\n[![docs.rs](https://docs.rs/rusttype/badge.svg)](https://docs.rs/rusttype)\n\nRustType is a pure Rust alternative to libraries like FreeType.\n\nThe current capabilities of RustType:\n\n* Reading OpenType formatted fonts and font collections. This includes `*.ttf`\n  as well as `*.otf` font files.\n* Retrieving glyph shapes and commonly used properties for a font and its glyphs.\n* Laying out glyphs horizontally using horizontal and vertical metrics, and\n  glyph-pair-specific kerning.\n* Rasterising glyphs with sub-pixel positioning using an accurate analytical\n  algorithm (not based on sampling).\n* Managing a font cache on the GPU with the `gpu_cache` module. This keeps\n  recently used glyph renderings in a dynamic cache in GPU memory to minimise\n  texture uploads per-frame. It also allows you keep the draw call count for\n  text very low, as all glyphs are kept in one GPU texture.\n\nNotable things that RustType does not support *yet*:\n\n* Font hinting.\n* Ligatures of any kind.\n* Some less common TrueType sub-formats.\n* Right-to-left and vertical text layout.\n\n## Testing \u0026 examples\nHeavier examples, tests \u0026 benchmarks are in the `./dev` directory. This avoids dev-dependency feature bleed.\n\nRun all tests with `cargo test --all --all-features`.\n\nRun examples with `cargo run --example \u003cNAME\u003e -p dev`\n\n## Getting Started\n\nTo hit the ground running with RustType, look at `dev/examples/ascii.rs`\nsupplied with the crate. It demonstrates loading a font file, rasterising an\narbitrary string, and displaying the result as ASCII art. If you prefer to just\nlook at the documentation, the entry point for loading fonts is `Font`,\nfrom which you can access individual fonts, then their glyphs.\n\n## Future Plans\n\nThe initial motivation for the project was to provide easy-to-use font rendering for games.\nThere are numerous avenues for improving RustType. Ideas:\n\n* Support for some common forms of ligatures.\n* And, eventually, support for embedded right-to-left Unicode text.\n\nIf you think you could help with achieving any of these goals, feel free to open\na tracking issue for discussing them.\n\n## Minimum supported rust compiler\nThis crate is maintained with [latest stable rust](https://gist.github.com/alexheretic/d1e98d8433b602e57f5d0a9637927e0c).\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\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\ndual licensed as above, without any additional terms or conditions.\n\n### See Also\n\n- [glyph_brush](https://github.com/alexheretic/glyph-brush) - can cache vertex generation \u0026 provides more complex layouts.\n","funding_links":[],"categories":["Libraries","Rust","库 Libraries","库"],"sub_categories":["Graphics","图形 Graphics","图像","图像 Graphics"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredox-os%2Frusttype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredox-os%2Frusttype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredox-os%2Frusttype/lists"}