Crate gfx_text[][src]

Expand description

A library for drawing text for gfx-rs graphics API. Uses freetype-rs underneath to former the font bitmap texture and collect information about face glyphs.


Basic usage:

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

// In render loop:

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

// Draw text.
text.draw(&mut stream);


Text renderer.

Text renderer builder. Allows to set rendering options using builder pattern.


General error type returned by the library. Wraps all other errors.

Represents possible errors which may occur during the font loading.

An anchor aligns text horizontally to its given x position.

An anchor aligns text vertically to its given y position.


Create a new text renderer builder. Alias for RendererBuilder::new.