• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

"fonts not found"

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use Apache POI to create a spreadsheet, which i will then email to users. My program creates the spreadsheet, then reads a file to fill in the rows, then writes the completed spreadsheet to a file. The environment is unix running on a mainframe. The program works great. I have problems when i try to add formatting. then it fails, and i get a confusing message about it not being able to find "fonts".

here's the line of code that causes the problem.


Workbook wb = new HSSFWorkbook();
......
Sheet sheet = wb.createSheet("Sheet1");
..........

sheet.autoSizeColumn((short)2);

the autoSizeColumn causes the problem. I suppose it needs the Font info to calculate the column size, but it can't find it for some reason. I see a directory in the Java JDK that seems to have font info in it (LucidaTypewriterRegular.ttf, etc).

the error is below.....I'm pretty new to java, so i could be missing something very basic. i hope so.... any ideas of where to research would be highly appreciated.

thanks


java.lang.Error: Probable fatal error:No fonts found.
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1095)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.initialiseDeferredFonts(FontManager.java:791)
at sun.java2d.SunGraphicsEnvironment.loadFonts(SunGraphicsEnvironment.java:432)
at sun.font.FontManager.findFont2D(FontManager.java:1927)
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1078)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.initialiseDeferredFonts(FontManager.java:791)
at sun.java2d.SunGraphicsEnvironment.loadFonts(SunGraphicsEnvironment.java:432)
at sun.font.FontManager.findFont2D(FontManager.java:1927)
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1078)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.initialiseDeferredFonts(FontManager.java:791)
at sun.java2d.SunGraphicsEnvironment.loadFonts(SunGraphicsEnvironment.java:432)
at sun.font.FontManager.findFont2D(FontManager.java:1927)
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1078)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.initialiseDeferredFonts(FontManager.java:791)
at sun.java2d.SunGraphicsEnvironment.loadFonts(SunGraphicsEnvironment.java:432)
at sun.font.FontManager.findFont2D(FontManager.java:1927)
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1078)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.initialiseDeferredFonts(FontManager.java:791)
at sun.java2d.SunGraphicsEnvironment.loadFonts(SunGraphicsEnvironment.java:432)
at sun.font.FontManager.findFont2D(FontManager.java:1927)
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1078)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.findJREDeferredFont(FontManager.java:878)
at sun.font.FontManager.findDeferredFont(FontManager.java:917)
at sun.font.FontManager.findFont2D(FontManager.java:1836)
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1078)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.findJREDeferredFont(FontManager.java:878)
at sun.font.FontManager.findDeferredFont(FontManager.java:917)
at sun.font.FontManager.findFont2D(FontManager.java:1836)
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1078)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.findJREDeferredFont(FontManager.java:878)
at sun.font.FontManager.findDeferredFont(FontManager.java:917)
at sun.font.FontManager.findFont2D(FontManager.java:1836)
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1078)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.findJREDeferredFont(FontManager.java:825)
at sun.font.FontManager.findDeferredFont(FontManager.java:917)
at sun.font.FontManager.findFont2D(FontManager.java:1836)
at sun.font.FontManager.findFont2D(FontManager.java:1797)
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1078)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
at sun.font.FontManager.initialiseDeferredFonts(FontManager.java:791)
at sun.java2d.SunGraphicsEnvironment.loadFonts(SunGraphicsEnvironment.java:432)
at sun.java2d.SunGraphicsEnvironment.getAllInstalledFonts(SunGraphicsEnvironment.java:526)
at sun.java2d.SunGraphicsEnvironment.getAllFonts(SunGraphicsEnvironment.java:578)
at sun.java2d.HeadlessGraphicsEnvironment.getAllFonts(HeadlessGraphicsEnvironment.java:90)
at SimpleExcel.main(SimpleExcel.java:37)


 
Sheriff
Posts: 21842
105
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Re-posted here with a possibly interesting reply.
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!