diff --git a/lib/GfxRenderer/GfxRenderer.cpp b/lib/GfxRenderer/GfxRenderer.cpp index 961a3063..d121e5cc 100644 --- a/lib/GfxRenderer/GfxRenderer.cpp +++ b/lib/GfxRenderer/GfxRenderer.cpp @@ -1919,6 +1919,11 @@ int GfxRenderer::getTextAdvanceX(const int fontId, const char* text, EpdFontFami return 0; } + if (fontCacheManager_ && fontCacheManager_->isScanning()) { + fontCacheManager_->recordText(text, fontId, style); + return 0; + } + uint32_t cp; uint32_t prevCp = 0; int widthPx = 0; @@ -1993,6 +1998,11 @@ void GfxRenderer::drawTextRotated90CW(const int fontId, const int x, const int y return; } + if (fontCacheManager_ && fontCacheManager_->isScanning()) { + fontCacheManager_->recordText(text, fontId, style); + return; + } + const auto& font = fontIt->second; int lastBaseY = y;