alexheretic / glyph-brush

Fast GPU cached text rendering
Apache License 2.0
673 stars 52 forks source link

glyph_brush_draw_cache: are duplicate queued glyphs eliminated? #171

Closed tareksander closed 7 months ago

alexheretic commented 7 months ago

When you call cache_queued all similar enough queued glyphs will indeed use a single drawn quad in the texture cache. That is the job of the crate.

Note that "duplicate" glyphs may end up drawn into the cache multiple times if queued with different subpixel positions.

Run the example to see how it works typing different position and size characters.

tareksander commented 7 months ago

So I can just queue all glyphs I want to draw and e.g. multiple 'C's with the same parameters get deduplicated? That's great.