python-PyMuPDF/0001-fix-test_-font.patch
Michael J Gruber fe70406307 Update to new upstream release 1.24.4 (rhbz#2280912)
- Various fixes (1.24.3, 1.24.4)
- The Python module is now (1.24.3 and up) called `pymupdf`. `fitz` is still supported for backwards compatibility.
2024-05-17 10:42:38 +02:00

44 lines
1.4 KiB
Diff

From 34f259627a1ba6c354b7108cc36b3aa8e3ee3581 Mon Sep 17 00:00:00 2001
Message-ID: <34f259627a1ba6c354b7108cc36b3aa8e3ee3581.1714747659.git.mjg@fedoraproject.org>
From: Michael J Gruber <mjg@fedoraproject.org>
Date: Sat, 15 Apr 2023 17:53:27 +0200
Subject: [PATCH] fix test_*font
Depending on build options and system, noto fonts may or may not be
present. Thus font tests expecting them may fail for the wrong reason.
Adjust the tests to use the fallback font instead.
---
tests/test_general.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/test_general.py b/tests/test_general.py
index 9b4b7aca..829ec0cf 100644
--- a/tests/test_general.py
+++ b/tests/test_general.py
@@ -162,9 +162,9 @@ def test_bug1971():
assert doc.is_closed
def test_default_font():
- f = pymupdf.Font()
- assert str(f) == "Font('Noto Serif Regular')"
- assert repr(f) == "Font('Noto Serif Regular')"
+ f = pymupdf.Font(ordering=0)
+ assert str(f) == "Font('Droid Sans Fallback Regular')"
+ assert repr(f) == "Font('Droid Sans Fallback Regular')"
def test_add_ink_annot():
import math
@@ -227,7 +227,7 @@ def test_get_text_dict():
json.dumps( blocks, indent=4)
def test_font():
- font = pymupdf.Font()
+ font = pymupdf.Font(ordering=0)
print(repr(font))
bbox = font.glyph_bbox( 65)
print( f'bbox={bbox!r}')
--
2.45.0.126.g110af8c3bd