DjVu: flatten nested text layer

Closes #2943.
This commit is contained in:
Frans de Jonge authored and Frans de Jonge committed 2025-09-27 12:48:02 +02:00
1 parent d71d134844
commit f69a2eebb2
2 files changed
+152 -3

No files matched your search

+2 -2
View File
@@ -985,7 +985,8 @@ function KoptInterface:getTextFromBoxes(boxes, pos0, pos1)
local prev_word
local prev_word_end_x
for j = j0, j1 do
local word = boxes[i][j].word
local box = boxes[i][j]
local word = box and box.word
if word then
if not line_first_word_seen then
line_first_word_seen = true
@@ -1005,7 +1006,6 @@ function KoptInterface:getTextFromBoxes(boxes, pos0, pos1)
end
end
end
local box = boxes[i][j]
if prev_word then
-- A box should have been made for each word, so assume
-- we want a space between them, with some exceptions