luminance-glyph

Crates.ioluminance-glyph
lib.rsluminance-glyph
version0.5.0
sourcesrc
created_at2020-07-08 21:19:30.925134
updated_at2023-01-23 01:47:50.472139
descriptionA fast text renderer for luminance, powered by glyph_brush.
homepage
repositoryhttps://github.com/JohnDoneth/luminance-glyph
max_upload_size
id262650
size177,017
John Doneth (JohnDoneth)

documentation

README

luminance-glyph

Integration status crates.io Documentation License

A fast text renderer for luminance, powered by glyph_brush. Initially forked and modified from glow_glyph by hecrj. Many thanks to hecrj for his work on glow_glyph!

let mut glyph_brush = GlyphBrushBuilder::using_font(ab_glyph::FontArc::try_from_slice(
        include_bytes!("Inconsolata-Regular.ttf"),
    )?)
    .build(&mut surface);
    
glyph_brush.queue(
    Section::default().add_text(
        Text::new("Hello Luminance Glyph")
            .with_color([1.0, 1.0, 1.0, 1.0])
            .with_scale(80.0),
    ),
);

glyph_brush.process_queued(&mut surface);

surface.pipeline_builder().pipeline(
    &back_buffer,
    &PipelineState::default().set_clear_color([0.2, 0.2, 0.2, 1.0]),
    |mut pipeline, mut shd_gate| {
        glyph_brush
            .draw_queued(&mut pipeline, &mut shd_gate, 1024, 720)
            .expect("failed to render glyphs");
    },
);
Commit count: 33

cargo fmt