From 639a9f350c4288e7526874d2248d3d3f48f40b35 Mon Sep 17 00:00:00 2001 From: jpirnay Date: Tue, 28 Apr 2026 16:18:53 +0200 Subject: [PATCH] Address hyphen review comment --- lib/Epub/Epub/ParsedText.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Epub/Epub/ParsedText.cpp b/lib/Epub/Epub/ParsedText.cpp index f081060d..ba257c9e 100644 --- a/lib/Epub/Epub/ParsedText.cpp +++ b/lib/Epub/Epub/ParsedText.cpp @@ -156,7 +156,7 @@ void ParsedText::layoutAndExtractLines( // (advanceX only, no bitmaps) for all unique codepoints in this paragraph so // that calculateWordWidths() can measure text without on-demand SD I/O. if (renderer.isSdCardFont(fontId)) { - size_t totalSize = hyphenationEnabled ? 1 : 0; + size_t totalSize = 1; // reserve room for a possible hyphen fallback if (!words.empty()) totalSize += words.size() - 1; // inter-word spaces for (const auto& w : words) totalSize += w.size(); std::string allText; @@ -165,7 +165,7 @@ void ParsedText::layoutAndExtractLines( if (i > 0) allText += ' '; allText += words[i]; } - if (hyphenationEnabled) allText += '-'; + allText += '-'; renderer.ensureSdCardFontReady(fontId, allText.c_str()); }