Crates.io | glow_glyph |
lib.rs | glow_glyph |
version | 0.7.0 |
source | src |
created_at | 2020-05-21 17:15:09.498321 |
updated_at | 2024-05-19 09:36:43.779023 |
description | A fast text renderer for glow, powered by glyph_brush |
homepage | |
repository | https://github.com/hecrj/glow_glyph |
max_upload_size | |
id | 244213 |
size | 211,366 |
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,
);
Have a look at
cargo run --example hello
cargo run --example clipping