gfx_glyph crates.io

Documentation

Fast GPU cached text rendering using gfx-rs v0.18 & glyph-brush.

```rust use gfxglyph::{abglyph::FontArc, GlyphBrushBuilder, Section, Text};

let dejavu = FontArc::tryfromslice(includebytes!("../../fonts/DejaVuSans.ttf"))?; let mut glyphbrush = GlyphBrushBuilder::usingfont(dejavu).build(gfxfactory.clone());

// set the text scale, font, color, position, etc let section = Section::default() .addtext(Text::new("Hello gfxglyph"));

glyphbrush.queue(section); glyphbrush.queue(someothersection);

glyphbrush.usequeue().draw(&mut gfxencoder, &gfxcolor)?; ```

Examples

Have a look at * cargo run --example paragraph --release * cargo run --example performance --release * cargo run --example varied --release * cargo run --example depth --release

Limitations

The current implementation supports OpenGL (3.2 or later) only. Use glyph-brush directly if this is an issue.