Blob Blame History Raw
From 263b4d4ee701c0b27f0f7bc67af7d9f87f6332dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 14 Dec 2020 13:58:39 +0100
Subject: [PATCH] Use a specific font by ImageMagick
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The tests use ImageMagick to draw the labels into the pictures. This
does not work with ImageMagick-6.9.9.13-1.fc28.x86_64 and
rw-base35-fonts-20170801-1.fc28:

$ convert label:"The quick brown fox" test.png
convert: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1362.
convert: no images defined `test.png' @ error/convert.c/ConvertImageCommand/3258.

It also helps to make the test reproducible by using the same font all
the times.  Otherwise, a system could default to a different font and
that would change the rendered pixmaps and as a result it would break
the tests that checks the pixels in there.

This patch specifies DejaVu Sans family explicitly.

<https://bugzilla.redhat.com/show_bug.cgi?id=1494563>

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 t/1122_save_pdf_with_hocr.t      | 2 +-
 t/1128_save_pdf_with_sbs_hocr.t  | 2 +-
 t/113_save_pdf_with_downsample.t | 2 +-
 t/134_save_tiff_alpha.t          | 4 ++--
 t/1621_import_pdf.t              | 4 ++--
 t/1625_import_pdf_bw.t           | 4 ++--
 t/1627_import_encrypted_pdf.t    | 4 ++--
 t/1628_import_pdf_metadata.t     | 2 +-
 t/31_ocropus.t                   | 6 +++---
 t/32_ocropus_in_thread.t         | 2 +-
 t/33_cancel_ocropus.t            | 2 +-
 t/351_unpaper.t                  | 2 +-
 t/352_unpaper.t                  | 2 +-
 t/353_cancel_unpaper.t           | 4 ++--
 t/354_unpaper_with_error.t       | 2 +-
 t/355_unpaper2.t                 | 4 ++--
 t/356_unpaper_corrupt_image.t    | 2 +-
 t/357_unpaper_rtl.t              | 4 ++--
 t/358_unpaper_with_warning.t     | 2 +-
 t/411_tesseract.t                | 6 +++---
 t/412_tesseract_in_thread.t      | 2 +-
 t/413_cancel_tesseract.t         | 2 +-
 t/414_tesseract_with_error.t     | 2 +-
 t/421_cuneiform.t                | 6 +++---
 t/422_cuneiform_in_thread.t      | 2 +-
 t/423_cancel_cuneiform.t         | 2 +-
 t/424_cuneiform_with_error.t     | 2 +-
 t/431_gocr.t                     | 2 +-
 t/432_gocr.t                     | 2 +-
 t/433_cancel_gocr.t              | 2 +-
 t/434_gocr_with_error.t          | 2 +-
 t/51_process_chain.t             | 2 +-
 t/53_process_chain.t             | 2 +-
 t/54_process_chain_w_delete.t    | 2 +-
 t/55_process_chain_w_delete2.t   | 2 +-
 35 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/t/1122_save_pdf_with_hocr.t b/t/1122_save_pdf_with_hocr.t
index 31b4a3f..17c96c1 100644
--- a/t/1122_save_pdf_with_hocr.t
+++ b/t/1122_save_pdf_with_hocr.t
@@ -19,7 +19,7 @@ Gscan2pdf::Document->setup($logger);
 
 # Create test image
 system(
-    qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -units PixelsPerInch -density 300),
+    qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -units PixelsPerInch -density 300),
     'label:The quick brown fox',
     qw(-border 20x10 test.png)
 );
diff --git a/t/1128_save_pdf_with_sbs_hocr.t b/t/1128_save_pdf_with_sbs_hocr.t
index 17db912..bcb3833 100644
--- a/t/1128_save_pdf_with_sbs_hocr.t
+++ b/t/1128_save_pdf_with_sbs_hocr.t
@@ -19,7 +19,7 @@ Gscan2pdf::Document->setup($logger);
 
 # Create test image
 system(
-    qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -units PixelsPerInch -density 300),
+    qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -units PixelsPerInch -density 300),
     'label:The quick brown fox',
     qw(-border 20x10 test.png)
 );
diff --git a/t/113_save_pdf_with_downsample.t b/t/113_save_pdf_with_downsample.t
index ee50c8c..95a273e 100644
--- a/t/113_save_pdf_with_downsample.t
+++ b/t/113_save_pdf_with_downsample.t
@@ -18,7 +18,7 @@ my $logger = Log::Log4perl::get_logger;
 Gscan2pdf::Document->setup($logger);
 
 # Create test image
-system( qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+system( qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
     'label:The quick brown fox', 'test.png' );
 
 my $slist = Gscan2pdf::Document->new;
diff --git a/t/134_save_tiff_alpha.t b/t/134_save_tiff_alpha.t
index b97545b..b239614 100644
--- a/t/134_save_tiff_alpha.t
+++ b/t/134_save_tiff_alpha.t
@@ -18,7 +18,7 @@ Gscan2pdf::Document->setup($logger);
 
 # Create test image
 system(
-    qw(convert -fill lightblue -pointsize 12 -units PixelsPerInch -density 300),
+    qw(convert -fill lightblue), '-family', 'DejaVu Sans', qw(-pointsize 12 -units PixelsPerInch -density 300),
     'label:The quick brown fox',
     'test.png'
 );
@@ -46,7 +46,7 @@ Gtk3->main;
 
 like(
     capture(qw(identify test.tif)),
-    qr/test.tif TIFF 4\d\dx\d\d 4\d\dx\d\d\+0\+0 16-bit sRGB/,
+    qr/test.tif TIFF \d\d\dx\d\d \d\d\dx\d\d\+0\+0 16-bit sRGB/,
     'valid TIFF created'
 );
 
diff --git a/t/1621_import_pdf.t b/t/1621_import_pdf.t
index af31768..25c35eb 100644
--- a/t/1621_import_pdf.t
+++ b/t/1621_import_pdf.t
@@ -21,7 +21,7 @@ Gscan2pdf::Document->setup($logger);
 
 # Create b&w test image
 system(
-    qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -units PixelsPerInch -density 300),
+    qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -units PixelsPerInch -density 300),
     'label:The quick brown fox',
     'test.png'
 );
@@ -32,7 +32,7 @@ if ($tess_installed) {
 }
 else {
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         'test.tif'
     );
diff --git a/t/1625_import_pdf_bw.t b/t/1625_import_pdf_bw.t
index d1215f0..0835658 100644
--- a/t/1625_import_pdf_bw.t
+++ b/t/1625_import_pdf_bw.t
@@ -19,13 +19,13 @@ Gscan2pdf::Document->setup($logger);
 
 # Create test image
 system(
-    qw(convert +matte -depth 1 -colorspace Gray -type Bilevel -pointsize 12 -density 300),
+    qw(convert +matte -depth 1 -colorspace Gray -type Bilevel), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
     'label:The quick brown fox',
     'test.tif'
 );
 system(qw(tiff2pdf -o test.pdf test.tif));
 system(
-    qw(convert +matte -depth 1 -colorspace Gray -type Bilevel -pointsize 12 -density 300),
+    qw(convert +matte -depth 1 -colorspace Gray -type Bilevel), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
     'label:The quick brown fox',
     'test.png'
 );
diff --git a/t/1627_import_encrypted_pdf.t b/t/1627_import_encrypted_pdf.t
index 237ad07..76b1ddf 100644
--- a/t/1627_import_encrypted_pdf.t
+++ b/t/1627_import_encrypted_pdf.t
@@ -25,7 +25,7 @@ SKIP: {
 
     # Create b&w test image
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -units PixelsPerInch -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -units PixelsPerInch -density 300),
         'label:The quick brown fox',
         'test.png'
     );
@@ -36,7 +36,7 @@ SKIP: {
     }
     else {
         system(
-            qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+            qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
             'label:The quick brown fox',
             'input.tif'
         );
diff --git a/t/1628_import_pdf_metadata.t b/t/1628_import_pdf_metadata.t
index 809410d..56eb809 100644
--- a/t/1628_import_pdf_metadata.t
+++ b/t/1628_import_pdf_metadata.t
@@ -16,7 +16,7 @@ my $logger = Log::Log4perl::get_logger;
 Gscan2pdf::Document->setup($logger);
 
 # Create b&w test image
-system( qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+system( qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
     'label:The quick brown fox', 'test.tif' );
 system(
     qw(tiff2pdf -o test.pdf -e 20181231120000 -a Authör -t Title -s Sübject -k Keywörds test.tif)
diff --git a/t/31_ocropus.t b/t/31_ocropus.t
index 671645f..764a91e 100644
--- a/t/31_ocropus.t
+++ b/t/31_ocropus.t
@@ -19,7 +19,7 @@ SKIP: {
     skip 'Ocropus not installed', 7 unless Gscan2pdf::Ocropus->setup($logger);
 
     # Create test image
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.png' );
 
     my $got = Gscan2pdf::Ocropus->hocr(
@@ -31,7 +31,7 @@ SKIP: {
     like( $got, qr/The quick brown fox/, 'Ocropus returned sensible text' );
 
     # Create colour test image
-    system( qw(convert -fill lightblue -pointsize 12 -density 300),
+    system( qw(convert -fill lightblue), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.png' );
 
     $got = Gscan2pdf::Ocropus->hocr(
@@ -53,7 +53,7 @@ SKIP: {
       unless ( defined $languages->{'deu'} );
 
     # Create test image
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         "label:'öÖäÄüÜß'", 'test.png' );
 
     $got = Gscan2pdf::Ocropus->hocr(
diff --git a/t/32_ocropus_in_thread.t b/t/32_ocropus_in_thread.t
index 89ff31f..1a286af 100644
--- a/t/32_ocropus_in_thread.t
+++ b/t/32_ocropus_in_thread.t
@@ -23,7 +23,7 @@ SKIP: {
     skip 'Ocropus not installed', 2 unless Gscan2pdf::Ocropus->setup($logger);
 
     # Create test image
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.png' );
 
     my $slist = Gscan2pdf::Document->new;
diff --git a/t/33_cancel_ocropus.t b/t/33_cancel_ocropus.t
index 42dbacb..e9d1f0f 100644
--- a/t/33_cancel_ocropus.t
+++ b/t/33_cancel_ocropus.t
@@ -20,7 +20,7 @@ SKIP: {
     skip 'Ocropus not installed', 2 unless Gscan2pdf::Ocropus->setup($logger);
 
     # Create test image
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.png' );
 
     my $slist = Gscan2pdf::Document->new;
diff --git a/t/351_unpaper.t b/t/351_unpaper.t
index 215cd95..09fab9b 100644
--- a/t/351_unpaper.t
+++ b/t/351_unpaper.t
@@ -46,7 +46,7 @@ SKIP: {
 
     # Create test image
     system(
-        qw(convert -size 2100x2970 +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert -size 2100x2970 +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         'test.pnm'
     );
diff --git a/t/352_unpaper.t b/t/352_unpaper.t
index 8017a34..0bc14cd 100644
--- a/t/352_unpaper.t
+++ b/t/352_unpaper.t
@@ -45,7 +45,7 @@ SKIP: {
 
     # Create test image
     system(
-        qw(convert -size 2550x3507 +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert -size 2550x3507 +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         'test.pnm'
     );
diff --git a/t/353_cancel_unpaper.t b/t/353_cancel_unpaper.t
index 1092e27..33c3ea7 100644
--- a/t/353_cancel_unpaper.t
+++ b/t/353_cancel_unpaper.t
@@ -25,12 +25,12 @@ SKIP: {
 
     # Create test image
     system(
-        qw(convert +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         '1.pnm'
     );
     system(
-        qw(convert +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The slower lazy dog',
         '2.pnm'
     );
diff --git a/t/354_unpaper_with_error.t b/t/354_unpaper_with_error.t
index 96a817a..699a67f 100644
--- a/t/354_unpaper_with_error.t
+++ b/t/354_unpaper_with_error.t
@@ -46,7 +46,7 @@ SKIP: {
     # Create test image
     my $filename = 'test.png';
     system(
-        qw(convert -size 2100x2970 +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert -size 2100x2970 +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         "label:'The quick brown fox'",
         $filename
     );
diff --git a/t/355_unpaper2.t b/t/355_unpaper2.t
index bca79e6..3d0f3f2 100644
--- a/t/355_unpaper2.t
+++ b/t/355_unpaper2.t
@@ -23,12 +23,12 @@ SKIP: {
 
     # Create test image
     system(
-        qw(convert +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         '1.pnm'
     );
     system(
-        qw(convert +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The slower lazy dog',
         '2.pnm'
     );
diff --git a/t/356_unpaper_corrupt_image.t b/t/356_unpaper_corrupt_image.t
index 5e2a985..8743944 100644
--- a/t/356_unpaper_corrupt_image.t
+++ b/t/356_unpaper_corrupt_image.t
@@ -52,7 +52,7 @@ SKIP: {
 
     # Create test image
     system(
-        qw(convert -size 2100x2970 +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert -size 2100x2970 +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         'test.pnm'
     );
diff --git a/t/357_unpaper_rtl.t b/t/357_unpaper_rtl.t
index d393bd3..f2046c7 100644
--- a/t/357_unpaper_rtl.t
+++ b/t/357_unpaper_rtl.t
@@ -24,12 +24,12 @@ SKIP: {
 
     # Create test image
     system(
-        qw(convert +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         '1.pnm'
     );
     system(
-        qw(convert +matte -depth 1 -border 2x2 -bordercolor black -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -border 2x2 -bordercolor black), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The slower lazy dog',
         '2.pnm'
     );
diff --git a/t/358_unpaper_with_warning.t b/t/358_unpaper_with_warning.t
index b95d5f9..4673fd7 100644
--- a/t/358_unpaper_with_warning.t
+++ b/t/358_unpaper_with_warning.t
@@ -26,7 +26,7 @@ SKIP: {
     # Create test image
     my $filename = 'test.png';
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         qw(-rotate 20), $filename
     );
diff --git a/t/411_tesseract.t b/t/411_tesseract.t
index 2c1429b..b39e740 100644
--- a/t/411_tesseract.t
+++ b/t/411_tesseract.t
@@ -22,7 +22,7 @@ SKIP: {
 
     # Create b&w test image
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         'test.png'
     );
@@ -40,7 +40,7 @@ SKIP: {
     like( $got, qr/f(o|0)x/, 'Tesseract returned "fox"' );
 
     # Create colour test image
-    system( qw(convert -fill lightblue -pointsize 12 -density 300),
+    system( qw(convert -fill lightblue), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.png' );
 
     ( $got, $messages ) = Gscan2pdf::Tesseract->hocr(
@@ -62,7 +62,7 @@ SKIP: {
 
     # Create b&w test image
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         "label:'süß tränenüberströmt'",
         'test.png'
     );
diff --git a/t/412_tesseract_in_thread.t b/t/412_tesseract_in_thread.t
index dbc7a60..705ca34 100644
--- a/t/412_tesseract_in_thread.t
+++ b/t/412_tesseract_in_thread.t
@@ -26,7 +26,7 @@ SKIP: {
     # which should no longer occur, since v2.8.1 added --dpi to the tesseract
     # call
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         'test.png'
     );
diff --git a/t/413_cancel_tesseract.t b/t/413_cancel_tesseract.t
index eebef97..66c1c57 100644
--- a/t/413_cancel_tesseract.t
+++ b/t/413_cancel_tesseract.t
@@ -23,7 +23,7 @@ SKIP: {
 
     # Create test image
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         'test.tif'
     );
diff --git a/t/414_tesseract_with_error.t b/t/414_tesseract_with_error.t
index 90c7cc0..f60541a 100644
--- a/t/414_tesseract_with_error.t
+++ b/t/414_tesseract_with_error.t
@@ -24,7 +24,7 @@ SKIP: {
     # Create test image
     my $filename = 'test.png';
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         "label:'The quick brown fox'",
         $filename
     );
diff --git a/t/421_cuneiform.t b/t/421_cuneiform.t
index b0e0478..12e2c82 100644
--- a/t/421_cuneiform.t
+++ b/t/421_cuneiform.t
@@ -19,7 +19,7 @@ SKIP: {
       unless Gscan2pdf::Cuneiform->setup($logger);
 
     # Create test image
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.png' );
 
     my $got = Gscan2pdf::Cuneiform->hocr(
@@ -31,7 +31,7 @@ SKIP: {
     like( $got, qr/The quick brown fox/, 'Cuneiform returned sensible text' );
 
     # Create colour test image
-    system( qw(convert -fill lightblue -pointsize 12 -density 300),
+    system( qw(convert -fill lightblue), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.png' );
 
     $got = Gscan2pdf::Cuneiform->hocr(
@@ -49,7 +49,7 @@ SKIP: {
 
     # Create test image
     system(
-        qw(convert +matte -depth 1 -pointsize 12 -density 300 label:'öÖäÄüÜß' test.png)
+        qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-font DejaVu-Sans -pointsize 12 -density 300 label:'öÖäÄüÜß' test.png)
     );
 
     $got = Gscan2pdf::Cuneiform->hocr(
diff --git a/t/422_cuneiform_in_thread.t b/t/422_cuneiform_in_thread.t
index c22dbad..ace7e8d 100644
--- a/t/422_cuneiform_in_thread.t
+++ b/t/422_cuneiform_in_thread.t
@@ -24,7 +24,7 @@ SKIP: {
     Gscan2pdf::Document->setup($logger);
 
     # Create test image
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.png' );
 
     my $slist = Gscan2pdf::Document->new;
diff --git a/t/423_cancel_cuneiform.t b/t/423_cancel_cuneiform.t
index 50161d2..348b402 100644
--- a/t/423_cancel_cuneiform.t
+++ b/t/423_cancel_cuneiform.t
@@ -23,7 +23,7 @@ SKIP: {
     Gscan2pdf::Document->setup($logger);
 
     # Create test image
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.png' );
 
     my $slist = Gscan2pdf::Document->new;
diff --git a/t/424_cuneiform_with_error.t b/t/424_cuneiform_with_error.t
index 8bef9c0..e471b23 100644
--- a/t/424_cuneiform_with_error.t
+++ b/t/424_cuneiform_with_error.t
@@ -23,7 +23,7 @@ SKIP: {
 
     # Create test image
     my $filename = 'test.png';
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         "label:'The quick brown fox'", $filename );
 
     my $slist = Gscan2pdf::Document->new;
diff --git a/t/431_gocr.t b/t/431_gocr.t
index 7cab4ba..f016b37 100644
--- a/t/431_gocr.t
+++ b/t/431_gocr.t
@@ -21,7 +21,7 @@ SKIP: {
     Gscan2pdf::Document->setup($logger);
 
     # Create test image
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1 font DejaVu-Sans -pointsize 12 -density 300),
         'label:The quick brown fox', 'test.pnm' );
 
     my $slist = Gscan2pdf::Document->new;
diff --git a/t/432_gocr.t b/t/432_gocr.t
index 96936e1..86e8f3e 100644
--- a/t/432_gocr.t
+++ b/t/432_gocr.t
@@ -22,7 +22,7 @@ SKIP: {
 
     # Create test image
     system(
-'convert +matte -depth 1 -pointsize 12 -density 300 label:"öÖäÄüÜß" test.pnm'
+'convert +matte -depth 1 -family "DejaVu Sans" -pointsize 12 -density 300 label:"öÖäÄüÜß" test.pnm'
     );
 
     my $slist = Gscan2pdf::Document->new;
diff --git a/t/433_cancel_gocr.t b/t/433_cancel_gocr.t
index 8d397da..1774116 100644
--- a/t/433_cancel_gocr.t
+++ b/t/433_cancel_gocr.t
@@ -21,7 +21,7 @@ SKIP: {
     Gscan2pdf::Document->setup($logger);
 
     # Create test image
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox', 'test.pnm' );
 
     my $slist = Gscan2pdf::Document->new;
diff --git a/t/434_gocr_with_error.t b/t/434_gocr_with_error.t
index abac00c..7372065 100644
--- a/t/434_gocr_with_error.t
+++ b/t/434_gocr_with_error.t
@@ -22,7 +22,7 @@ SKIP: {
 
     # Create test image
     my $filename = 'test.pnm';
-    system( qw(convert +matte -depth 1 -pointsize 12 -density 300),
+    system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         "label:'The quick brown fox'", $filename );
 
     my $slist = Gscan2pdf::Document->new;
diff --git a/t/51_process_chain.t b/t/51_process_chain.t
index 592923e..ab8a315 100644
--- a/t/51_process_chain.t
+++ b/t/51_process_chain.t
@@ -34,7 +34,7 @@ SKIP: {
 
     # Create b&w test image
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         qw(-rotate -90 test.pnm)
     );
diff --git a/t/53_process_chain.t b/t/53_process_chain.t
index 1f16af6..ad7ec68 100644
--- a/t/53_process_chain.t
+++ b/t/53_process_chain.t
@@ -34,7 +34,7 @@ SKIP: {
 
     # Create b&w test image
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         qw(-rotate -90 test.pnm)
     );
diff --git a/t/54_process_chain_w_delete.t b/t/54_process_chain_w_delete.t
index 3790ab2..fc16d99 100644
--- a/t/54_process_chain_w_delete.t
+++ b/t/54_process_chain_w_delete.t
@@ -34,7 +34,7 @@ SKIP: {
 
     # Create b&w test image
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         qw(-rotate -90 test.pnm)
     );
diff --git a/t/55_process_chain_w_delete2.t b/t/55_process_chain_w_delete2.t
index 8856cba..91e53c0 100644
--- a/t/55_process_chain_w_delete2.t
+++ b/t/55_process_chain_w_delete2.t
@@ -34,7 +34,7 @@ SKIP: {
 
     # Create b&w test image
     system(
-        qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300),
+        qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
         'label:The quick brown fox',
         qw(-rotate -90 test.pnm)
     );
-- 
2.26.2