Crates.io | rusttype_bugfix_19072017 |
lib.rs | rusttype_bugfix_19072017 |
version | 0.2.1 |
source | src |
created_at | 2017-07-19 12:34:19.898266 |
updated_at | 2017-07-19 12:34:19.898266 |
description | A pure Rust alternative to libraries like FreeType. RustType provides an API for loading, querying and rasterising TrueType fonts. It also provides an implementation of a dynamic GPU glyph cache for hardware font rendering. |
homepage | https://github.com/dylanede/rusttype |
repository | https://github.com/dylanede/rusttype |
max_upload_size | |
id | 24081 |
size | 228,829 |
RustType is a pure Rust alternative to libraries like FreeType.
The current capabilities of RustType:
*.ttf
as well as a subset of *.otf
font files.gpu_cache
module. This keeps
recently used glyph renderings
in a dynamic cache in GPU memory to minimise texture uploads per-frame. It
also allows you keep the draw call count for text very low, as all glyphs are
kept in one GPU texture.Notable things that RustType does not support yet:
Add the following to your Cargo.toml:
[dependencies]
rusttype = "0.2.1"
To hit the ground running with RustType, look at the simple.rs
example
supplied with the crate. It demonstrates loading a font file, rasterising an
arbitrary string, and displaying the result as ASCII art. If you prefer to just
look at the documentation, the entry point for loading fonts is
FontCollection
, from which you can access individual fonts, then their glyphs.
The current state of RustType is only the beginning. There are numerous avenues for improving it. My main motivation for this project is to provide easy-to-use font rendering for games. My current focus is on a UI library that uses RustType. Once I get the time to go back and improve RustType itself, the improvements I am most interested in are:
If you think you could help with achieving any of these goals, feel free to open a tracking issue for discussing them.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.