Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,14 @@ export class SdfTrFontFace<
// Load the texture
stage.txManager.loadTexture(this.texture, true);

this.texture.once('loaded', () => {
// FIXME This is a stop-gap solution to avoid Font Face textures to be cleaned up
// Ideally we do want to clean up the textures if they're not being used to save as much memory as possible
// However, we need to make sure that the font face is reloaded if the texture is cleaned up and needed again
// and make sure the SdfFontRenderer is properly guarded against textures being reloaded
// for now this will do the trick and the increase on memory is not that big
this.texture.preventCleanup = true;

this.texture.on('loaded', () => {
this.checkLoaded();
// Make sure we mark the stage for a re-render (in case the font's texture was freed and reloaded)
stage.requestRender();
Expand Down
Loading