Open kurt-r2c opened 4 months ago
Which version of maven are you using:
mvn -version
@asturio 3.9.6
I'd like to find a font provided by all OS. Are there any other Mac-Users who can confirm, that this test also fails on their computer? Which font could be used instead. Alternatively, the test could be disabled on MacOS.
Just checked, that courier is also bundled with OpenPDF. So even a more strange behavior here.
The call of FontFactory.registerDirectories();
was made only in one of the tests. It could be, that the order of the tests are different in MacOS, and this call is necessary for all.
I just commited a little change. @kurt-r2c, can you please try, if the test passes now?
I'm also a Mac-user and can confirm that the aforementioned test still fails consistently on MacOs 14.6.1.
The test contains the beforeAll()
with FontFactory.registerDirectories();
call, so this doesn't seem to fix this issue. It indeed seems that the Courier font of the os is not compatible with the tests or the styles expectations.
Building it on Mac requires skipping this test. Unfortunately I'm not sure of any font to be consistently used on all os. Such a dependency on the local os setup will probably always cause flakey tests, since they may break after any update or change of the os.
Describe the bug
On OS X Ventura (13.0) or later, the Courier font is missing its
OS/2
table, probably due to licensing decisions made by Apple.This causes the
testFontStyleOfStyledFont
test to fail: https://github.com/LibrePDF/OpenPDF/blob/0a92bcc7ea9a41f919e093f774a3104865d92a42/openpdf/src/test/java/com/lowagie/text/pdf/fonts/FontTest.java#L81-L92To Reproduce
Run
mvn clean install
on OSX 13.0 or newer. The build will fail due to an exceptioncom.lowagie.text.DocumentException: Table 'OS/2' does not exist in /System/Library/Fonts/Courier.ttc
intestFontStyleOfStyledFont
.Setting
maven.test.failure.ignore
totrue
allows you to build the project but, for obvious reasons, this is a bad workaround for anything other than trivial changes.Expected behavior
It would be nice if this test failed gracefully if the font is not present or readable on the system.
System
(please complete the following information)
Your real name
Kurt Boberg