hocr: Pass text direction for standalone words

This commit is contained in:
James R. Barlow
2024-01-06 16:21:21 -08:00
parent 2c59aca5a1
commit 9498f01f59
+3 -1
View File
@@ -226,7 +226,7 @@ class HocrTransform:
root,
"ocrx_word",
invisible_text,
TextDirection.LTR,
direction,
True,
)
# put the image on the page, scaled to fill the page
@@ -376,6 +376,8 @@ class HocrTransform:
text.text_transform(Matrix(-1, 0, 0, -1, box.llx + box.width, 0))
text.horiz_scale(100 * box.width / font_width)
text.show(self._font.text_encode(elemtxt))
# elif text_direction == TextDirection.RTL:
# text.show(self._font.text_encode(elemtxt[::-1]))
# Get coordinates of the next word (if there is one)
hocr_next_box = (