https://github.com/hecrj/glow_glyph
A fast text renderer for glow (https://github.com/grovesNL/glow)
https://github.com/hecrj/glow_glyph
Last synced: about 6 hours ago
JSON representation
A fast text renderer for glow (https://github.com/grovesNL/glow)
- Host: GitHub
- URL: https://github.com/hecrj/glow_glyph
- Owner: hecrj
- Created: 2020-05-19T12:15:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-19T09:36:52.000Z (12 months ago)
- Last Synced: 2024-11-08T18:04:50.420Z (6 months ago)
- Language: Rust
- Homepage:
- Size: 89.8 KB
- Stars: 13
- Watchers: 3
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# glow_glyph
[](https://github.com/hecrj/glow_glyph/actions)
[](https://crates.io/crates/glow_glyph)
[](https://docs.rs/glow_glyph)
[](https://github.com/hecrj/glow_glyph/blob/master/LICENSE)A fast text renderer for [glow](https://github.com/grovesNL/glow), powered by
[glyph_brush](https://github.com/alexheretic/glyph-brush/tree/master/glyph-brush)```rust
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`