How do I release FONT in C_API?


It seems that playdate->graphics->loadFont() and its counterpart playdate->graphics->freeFont() do not exist (maybe not published).

Perhaps I should just realloc(font, 0)?

Best regards.

You're right, that's not great API design. :frowning: If we did have a freeFont() it would just call free() on the font, but ideally we'd have a proper separate function not just to make it clear how you free the fonts but so we can adjust it as needed in the future if we make any changes to the font structure.

Until then, calling realloc(font,0) is the best way to free the font object.

1 Like

Thank you for your response.

Well, unlike Bitmap or AudioSample, I don't have the opportunity to release them that often, but I was curious so I checked.

I will realloc(font, 0) until the API is added.

1 Like