blaind/bevy_text_mesh

Mesh cache purging

blaind opened this issue · 1 comments

The crate uses a global mesh cache.

It is not being cleaned up at all, resulting to polluted cache, when:

  • user does not render with a specific font anymore
  • user creates glyphs with varying depths (maybe generate mesh with constant depth, and change vertice depths at runtime?)

The first point could probably be improved by beeing able to manually clear the cache for a certain font.
Regarding the second point I would definetly only store the mesh with a depth of one (+ maybe the flat 2D mesh) and then scale the depth component as needed during runtime. The same should probably be done regarding the different font sizes (e.g. store one fixed size mesh and scale it as needed to accomodate for different font size).