diff --git a/lib/EpdFont/FontDecompressor.h b/lib/EpdFont/FontDecompressor.h index 8f574dba..afb9c61c 100644 --- a/lib/EpdFont/FontDecompressor.h +++ b/lib/EpdFont/FontDecompressor.h @@ -7,7 +7,7 @@ class FontDecompressor { public: static constexpr uint16_t MAX_PAGE_GLYPHS = 512; - static constexpr uint8_t MAX_PAGE_SLOTS = 4; // One per font style (R/B/I/BI) + static constexpr uint8_t MAX_PAGE_SLOTS = 8; // Provide enough slots for heavily stylized HTML pages FontDecompressor() = default; ~FontDecompressor(); diff --git a/lib/GfxRenderer/FontCacheManager.cpp b/lib/GfxRenderer/FontCacheManager.cpp index b55fdf08..36620f2e 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()) {