• I think you hit a case nobody thought about before. At least I did not. "removable" apps are expected to cleanup all changes they did to global state while they are unloaded. In my opinion that includes the loading of fonts.
    Widgets are the one notable exception to this general rule, just because it is not easy to completely get rid of widgets. In your case the app removes the font as it should but the widget still exists and expects it to be there. I suspect the loading of the font only takes place once in the widget and one of the following draws then fails.

    1. Clock loaded, widgets loaded, font available globally
    2. Switch from clock to launcher, widgets still loaded, font removed by clock
    3. Something calls draw of widget, fails because of missing font.

    There are a few possible solutions:

    • Checking for the font in the widgets draw and reloading it if needed
    • Not unloading fonts at all, probably problematic on Bangle 1 because of memory constraints
    • Make the loading of fonts more local to app/widget instead of the global graphics object
    • Attach a counter to a font on load and only really unload it if there is no user left

    There probably are more ways to get this done but some discussion on this will be needed since will affect global behaviour.


Avatar for halemmerich @halemmerich started