#font #ttf #truetype #text #glow

glow_glyph

A fast text renderer for glow, powered by glyph_brush

5 releases (3 breaking)

0.3.0 Jul 27, 2020
0.2.1 Jun 27, 2020
0.2.0 May 27, 2020
0.1.0 May 22, 2020
0.0.0 May 21, 2020

#90 in Rendering

Download history 94/week @ 2020-05-19 521/week @ 2020-05-26 575/week @ 2020-06-02 348/week @ 2020-06-09 246/week @ 2020-06-16 465/week @ 2020-06-23 413/week @ 2020-06-30 521/week @ 2020-07-07 447/week @ 2020-07-14 161/week @ 2020-07-21 452/week @ 2020-07-28 184/week @ 2020-08-04

1,263 downloads per month

MIT license

74KB
698 lines

glow_glyph

Integration status crates.io Documentation License

A fast text renderer for glow, powered by glyph_brush

use glow_glyph::{Section, GlyphBrushBuilder};

let font: &[u8] = include_bytes!("SomeFont.ttf");
let mut glyph_brush = GlyphBrushBuilder::using_font_bytes(font)
    .expect("Load font")
    .build(&glow_context);

let section = Section {
    text: "Hello glow_glyph",
    ..Section::default() // color, position, etc
};

glyph_brush.queue(section);
glyph_brush.queue(some_other_section);

glyph_brush.draw_queued(
    &glow_context,
    window_width,
    window_height,
);

Examples

Have a look at

  • cargo run --example hello
  • cargo run --example clipping

Dependencies

~1.6–3.5MB
~65K SLoC