hecrj / wgpu_glyph

A fast text renderer for wgpu (https://github.com/gfx-rs/wgpu)
https://docs.rs/wgpu_glyph
MIT License
441 stars 77 forks source link

Get bounding box of drawn text #86

Closed ghost closed 2 years ago

ghost commented 2 years ago

I need to know the dimensions of the rendered text after it is drawn or calculate if beforehand. Is there a suitable method for that in this library?

hecrj commented 2 years ago

You can use the GlyphCruncher trait.

ghost commented 2 years ago

Seems like it should do the trick. Thanks.