Skip to content

Commit

Permalink
tests/test_font.py: added test_mupdf_subset_fonts2().
Browse files Browse the repository at this point in the history
Checks that fitz.mupdf.pdf_subset_fonts2() can be called.
  • Loading branch information
julian-smith-artifex-com committed Feb 27, 2024
1 parent 20f35ac commit 6acf394
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_font.py
Expand Up @@ -110,3 +110,17 @@ def f_fallback(script, language, serif, bold, italic):
], f'Incorrect {trace=}.'
print(f'test_load_system_font(): {f.m_internal=}')


def test_mupdf_subset_fonts2():
if not hasattr(fitz, 'mupdf'):
print('Not running on rebased.')
return
if fitz.mupdf_version_tuple < (1, 24):
print('Not running with mupdf < 1.24.')
return
path = os.path.abspath(f'{__file__}/../../tests/resources/2.pdf')
with fitz.open(path) as doc:
n = len(doc)
pages = [i*2 for i in range(n//2)]
print(f'{pages=}.')
fitz.mupdf.pdf_subset_fonts2(fitz._as_pdf_document(doc), pages)

0 comments on commit 6acf394

Please sign in to comment.