Fix "Probable fatal error:No fonts found" issue un

When I call sheet.autoSizeColumn(0) under Linux Server, I got following error message:

java.lang.Error: Probable fatal error:No fonts found.

sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1089)

sun.font.FontManager.initialiseDeferredFont(FontManager.java:968)

sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:254)

sun.font.CompositeFont.getSlotFont(CompositeFont.java:334)

sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)

sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)

sun.font.CompositeFont.getMapper(CompositeFont.java:390)

sun.font.CompositeFont.canDisplay(CompositeFont.java:416)

java.awt.Font.canDisplayUpTo(Font.java:2041)

java.awt.font.TextLayout.singleFont(TextLayout.java:469)

java.awt.font.TextLayout.<init>(TextLayout.java:527)

org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:208)

org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:386)

org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:369)

That is caused by the Linux font issue. Execute following command can fix this issue:

sudo yum install liberation-*;  


你可能感兴趣的:(issue)