Also fix space rendering

This commit is contained in:
James R. Barlow
2023-12-24 00:09:47 -08:00
parent 9adcad84da
commit 18353e1e94
+1 -1
View File
@@ -390,7 +390,7 @@ class HocrTransform:
elif text_direction == TextDirection.RTL:
space_box = Rectangle(next_box.urx, box.lly, box.llx, next_box.ury)
self._debug_draw_space_bbox(canvas, space_box)
text.text_transform(Matrix(1, 0, 0, 1, space_box.llx, 0))
text.text_transform(Matrix(1, 0, 0, -1, space_box.llx, 0))
space_width = self._font.text_width(' ', fontsize)
if space_width > 0:
text.horiz_scale(100 * space_box.width / space_width)