diff --git a/lib/GfxRenderer/FontCacheManager.cpp b/lib/GfxRenderer/FontCacheManager.cpp index ff13fb8d..9c34a0ec 100644 --- a/lib/GfxRenderer/FontCacheManager.cpp +++ b/lib/GfxRenderer/FontCacheManager.cpp @@ -24,6 +24,8 @@ void FontCacheManager::clearCache() { } void FontCacheManager::prewarmCache(int fontId, const char* utf8Text, uint8_t styleMask) { + clearCache(); + // SD card font prewarm path: prewarm all requested styles in one call auto sdIt = sdCardFonts_.find(fontId); if (sdIt != sdCardFonts_.end()) { @@ -51,11 +53,8 @@ void FontCacheManager::prewarmCache(int fontId, const char* utf8Text, uint8_t st if (!data || !data->groups) continue; int missed = fontDecompressor_->prewarmCache(data, utf8Text); if (missed < 0) { - LOG_DBG("FCM", "prewarmCache: Cache slots full! Clearing and retrying slot allocation."); - clearCache(); - missed = fontDecompressor_->prewarmCache(data, utf8Text); - } - if (missed > 0) { + LOG_DBG("FCM", "prewarmCache: Decompressor slots full during style %d!", i); + } else if (missed > 0) { LOG_DBG("FCM", "prewarmCache: %d glyph(s) not cached for style %d", missed, i); } }