From b54f2bcc0576857e8342ca2de73489c90e3ed0cf Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 26 Jan 2026 15:09:46 +0000 Subject: [PATCH 1/2] Update test_3780 to avoid tripping on non-text blocks. The test extracts text and images from a page. It drops any images that are not fully included within the mediabox. Accordingly the test never sees any images, so works fine. In a new MuPDF commit, when the CLIP flag is sent, images are restricted to the clip region - i.e. they always fit within the mediabox, hence we now have images appearing in the list. The fix is to skip any non-text blocks in the test. --- tests/test_font.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_font.py b/tests/test_font.py index 834db349d..136b3aaf9 100644 --- a/tests/test_font.py +++ b/tests/test_font.py @@ -206,6 +206,8 @@ def test_3780(): # print(f' {n}: {v!r}') for i, block in enumerate(d['blocks']): print(f'block {i}:') + if block['type'] != 0: + continue for j, line in enumerate(block['lines']): print(f' line {j}:') for k, span in enumerate(line['spans']): From e05d3ac4198728341f5ba8363434cc54b7987cad Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 26 Jan 2026 19:01:36 +0000 Subject: [PATCH 2/2] Add missing STEXT CLIP definition. --- src/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/__init__.py b/src/__init__.py index 874e59cc4..764e6c91b 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -17597,6 +17597,7 @@ def width(self): TEXT_COLLECT_VECTORS = mupdf.FZ_STEXT_COLLECT_VECTORS TEXT_IGNORE_ACTUALTEXT = mupdf.FZ_STEXT_IGNORE_ACTUALTEXT TEXT_SEGMENT = mupdf.FZ_STEXT_SEGMENT +TEXT_CLIP = mupdf.FZ_STEXT_CLIP if mupdf_version_tuple >= (1, 27, 1): TEXT_LAZY_VECTORS = mupdf.FZ_STEXT_LAZY_VECTORS