Add tests for fpdf2 renderer and font infrastructure

- Add hOCR test fixtures for Latin, Arabic, CJK, Devanagari scripts
- Add tests for fpdf2 renderer, multi-font manager, system font provider
- Add multilingual rendering tests
- Update existing tests to use fpdf2 renderer
This commit is contained in:
James R. Barlow
2026-01-06 13:46:11 -08:00
parent 7a4b98974c
commit bbd263ff48
20 changed files with 2276 additions and 149 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ from ocrmypdf.pdfinfo import PdfInfo
from .conftest import check_ocrmypdf, have_unpaper, run_ocrmypdf
RENDERERS = ['hocr', 'sandwich']
RENDERERS = ['fpdf2', 'sandwich']
def test_deskew(resources, outdir):
@@ -79,7 +79,7 @@ def test_remove_background(resources, outdir):
@pytest.mark.parametrize(
"pdf", ['palette.pdf', 'cmyk.pdf', 'ccitt.pdf', 'jbig2.pdf', 'lichtenstein.pdf']
)
@pytest.mark.parametrize("renderer", ['sandwich', 'hocr'])
@pytest.mark.parametrize("renderer", ['sandwich', 'fpdf2'])
@pytest.mark.parametrize("output_type", ['pdf', 'pdfa'])
def test_exotic_image(pdf, renderer, output_type, resources, outdir):
outfile = outdir / f'test_{pdf}_{renderer}.pdf'