PhilterPaper / Perl-PDF-Builder

Extended version of the popular PDF::API2 Perl-based PDF library for creating, reading, and modifying PDF documents
https://www.catskilltech.com/FreeSW/product/PDF%2DBuilder/title/PDF%3A%3ABuilder/freeSW_full
Other
6 stars 7 forks source link

Ci #161

Closed carygravel closed 3 years ago

carygravel commented 3 years ago

This expands the tests run in the CI to three different runners:

Once #158 is fixed, I'll add Windows runners with and without Imagemagick

Note that the Github Linux runner doesn't define default fonts in Imagemagick, so I had to add them explicitly in t/tiff. We may need a couple of iterations to find fonts that exist on Windows and in the Github Linux runner (or the Linux package with the missing fonts).

PhilterPaper commented 3 years ago

Possible problem here. I see you are hard coding Dejavu Sans fonts. I do have this font family installed on my Windows 10, but I'm not sure that it comes with any Windows by default (https://docs.microsoft.com/en-us/typography/fonts/). I don't know if I installed it from somewhere else, or it came with Windows. If it doesn't come with Windows, it could be a problem with the tests. Is there a real need to specify the font?

carygravel commented 3 years ago

Currently, the default Linux runner fails to create any image with text unless a font is specified. This is why I said above:

Note that the Github Linux runner doesn't define default fonts in Imagemagick, so I had to add them explicitly in t/tiff. We may need a couple of iterations to find fonts that exist on Windows and in the Github Linux runner (or the Linux package with the missing fonts).

So if I take away the font, then all tests with images with text fail.

Note that default Windows font are typically owned by Microsoft, therefore not open source, and therefore not available on Linux.

It might be easier to check that the font is available and skip the tests if it is not.

Alternatively, I can try and create test images that don't have text, and therefore don't need fonts. I think I like this idea better. Indeed,I was trying to do exactly this when I came across #154. So I'll fix #154 first and then come back to this PR. The other advantage with images that don't need fonts is we can make them very small. Therefore, if they fail, they don't then dump hundreds of lines of mismatching pixels to the terminal.