From 12f16e9b28944b09813718562a45c4f598a2a0c1 Mon Sep 17 00:00:00 2001 From: jpirnay Date: Wed, 29 Apr 2026 14:53:45 +0200 Subject: [PATCH] when scanning, route through a metadata-only path --- lib/GfxRenderer/GfxRenderer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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;