gfx_text Build Status crates.io

Library for drawing text for gfx-rs graphics API. Uses freetype-rs underneath.

Usage

Basic usage:

```rust // Initialize text renderer. let mut text = gfx_text::new(factory).build().unwrap();

// In render loop:

// Draw some text 10 pixels down and right from the top left screen corner. text.draw( "The quick brown fox jumps over the lazy dog", // Text to draw [10, 10], // Position [0.65, 0.16, 0.16, 1.0], // Text color );

// Render the final batch. text.draw_end(&mut stream); ```

See API documentation for overview of all available methods.

You can skip default font by disabling include-font feature:

[dependencies.gfx_text] version = "*" default-features = false

Examples

See this example on how to draw text in various styles: different sizes, colors, fonts, etc.

Output:

License