Crates.io | sdl2_ttf |
lib.rs | sdl2_ttf |
version | 0.25.1 |
source | src |
created_at | 2014-11-26 09:40:18.737766 |
updated_at | 2016-11-06 02:49:37.060524 |
description | SDL2_ttf bindings for Rust |
homepage | |
repository | https://github.com/andelf/rust-sdl2_ttf |
max_upload_size | |
id | 403 |
size | 56,922 |
Rust bindings for SDL2_ttf.
Rust-SDL2_ttf is a library for talking to the new SDL2_ttf library from Rust.
Rust-SDL2_ttf uses the MIT licence.
Place the following into your project's Cargo.toml file:
[dependencies]
sdl2_ttf = "0.25"
sdl2_ttf is directly compatible with the corresponding version of sdl2. Hence sdl2_ttf v0.15 is compatible with sdl2 0.15, and so forth. Backwards compatibility is not guaranteed by rust-sdl2, so take that into account when creating new projects !
If you want the newest rust-sdl2_ttf, reference the repository:
[dependencies.sdl2_ttf]
git = "https://github.com/andelf/rust-sdl2_ttf"
You can also just clone and build the library yourself:
git clone https://github.com/andelf/rust-sdl2_ttf
cd rust-sdl2_ttf
cargo build
# TODO: OR if you are using the mac framework version
rustc -L. --cfg mac_framework src/sdl2_ttf/lib.rs
If you're not using Cargo, you can compile the library manually:
git clone https://github.com/andelf/rust-sdl2_ttf
cd rust-sdl2_ttf
rustc src/sdl2_ttf/lib.rs
A simple demo that prints out a string given a font is included:
cargo run --example demo /path/to/font.(ttf|ttc|fon)