From f2714586d80e22ae984925752c197c8f4577ebd6 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Sat, 23 Dec 2023 23:44:37 -0800 Subject: [PATCH] Fix upside down glyphless font --- src/ocrmypdf/hocrtransform/_hocr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ocrmypdf/hocrtransform/_hocr.py b/src/ocrmypdf/hocrtransform/_hocr.py index 77088b36..aa17252d 100644 --- a/src/ocrmypdf/hocrtransform/_hocr.py +++ b/src/ocrmypdf/hocrtransform/_hocr.py @@ -363,7 +363,7 @@ class HocrTransform: # If this word is 0 units wide, our best bet seems to be to suppress this text if font_width > 0: - text.text_transform(Matrix(1, 0, 0, 1, box.llx, 0)) + text.text_transform(Matrix(1, 0, 0, -1, box.llx, 0)) text.horiz_scale(100 * box.width / font_width) text.show(elemtxt.encode('utf-16be'))