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.Notable things that RustType does not support yet:
Add the following to your Cargo.toml:
toml
[dependencies]
rusttype = "0.1.2"
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. Thus I will be constructing a GPU font caching library based on RustType. Once I get the time to go back and improve RustType itself, the main 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.