Skip to content

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Sep 12, 2025

Objective

Add functions that allow users to manually clear all the font atlases for a specific font face or all font faces.

Solution

Add a clear method to FontAtlasSet that can be used to free all the font atlases for a specific font face.
Add a clear method to FontAtlasSets that frees all the font atlases for every font.

This isn't great but at least allows users to avoid the memory leaks when changing a font size or the scale factor.

@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior A-Text Rendering and layout for characters D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 12, 2025
Copy link
Contributor

@mogambro mogambro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Straightforward.

While I agree it's not a particular ergonomic solution overall - because it has to be done manually -, it is a solution indeed.

@viridia
Copy link
Contributor

viridia commented Sep 25, 2025

Does #21211 supplant this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Text Rendering and layout for characters C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants