Create the standard 14 fonts with Standard14Fonts.FontName

MSAL

PDFBox 3.0 removed the static PDType1Font instances of the standard 14 fonts, such as PDType1Font.HELVETICA, because their shared, mutable dictionaries caused problems. This creates the font where each was used, with new PDType1Font(Standard14Fonts.FontName.HELVETICA), and does the same for PDFontFactory.createDefaultFont(), which PDFBox 3.0 also removed. The instances are no longer shared, so a comparison by identity with one of them no longer holds. Where a JUnit or TestNG assertion compares a font with one of them for equality, it compares their names, as assertEquals(Standard14Fonts.FontName.HELVETICA.getName(), font.getName()).

org.openrewrite.apache.pdfbox.MigrateStandard14Fonts
mod run . --recipe=org.openrewrite.apache.pdfbox.MigrateStandard14Fonts

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.