This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

"fonts not found"

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22701
129
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Re-posted here with a possibly interesting reply.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic