Unfortunately I faced today during tests execution on GitHub Actions runner: java.lang.RuntimeException: Fontconfig head is null, check your fonts or fonts configuration
as well.
I use:
testImplementation "org.apache.poi:poi:5.3.0"
testImplementation "org.apache.poi:poi-ooxml:5.3.0"
Java21 Corretto
Github runner is on Linux X64
Log:
SmthExcelConverterTest > should convert smth to excel FAILED
java.lang.RuntimeException: Fontconfig head is null, check your fonts or fonts configuration
at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1263)
at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:221)
at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:105)
at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:696)
at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:352)
at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:309)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:309)
at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:55)
at java.desktop/sun.font.PlatformFontInfo.createFontManager(PlatformFontInfo.java:37)
at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:51)
at java.desktop/java.awt.Font.getFont2D(Font.java:526)
at java.desktop/java.awt.Font.canDisplayUpTo(Font.java:2278)
at java.desktop/java.awt.font.TextLayout.singleFont(TextLayout.java:469)
at java.desktop/java.awt.font.TextLayout.<init>(TextLayout.java:530)
at org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:262)
at org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:223)
at org.apache.poi.ss.util.SheetUtil.getColumnWidthForRow(SheetUtil.java:399)
at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:318)
at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:295)
at org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:497)
at org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:479)
at (some invocation of autoSizeColumn in my code)