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

hi

we are trying to generate excel from pl/sql.

we generate excel.

we set the -Djava.awt.headless=true

but when we set the worksheet.autofitcolumns();

we get the following exceptions.

Exception in thread “Root Thread” java.lang.Error: Probable fatal error:No fonts found.
at sun.font.FontManager.getFont2D(FontManager.java)
at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:167)
at sun.font.FontDesignMetrics.(FontDesignMetrics.java:160)
at sun.font.FontDesignMetrics.(FontDesignMetrics.java:145)
at oracle.aurora.awt.OracleToolkit.getFontMetrics(OracleToolkit.java:297)
at sun.awt.HeadlessToolkit.getFontMetrics(HeadlessToolkit.java:371)
at java.awt.Component.getFontMetrics(Component.java:2524)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1589)
at com.aspose.cells.bJ.c(Unknown Source)
at com.aspose.cells.bJ.(Unknown Source)
at com.aspose.cells.in.a(Unknown Source)
at com.aspose.cells.in.(Unknown Source)
at com.aspose.cells.Worksheet.autoFitColumns(Unknown Source)
at autofitcolumn.testExcel(autofitcolumn.java)

any suggestions on this will be appreciated.

Thanks & regards.
Ranjith


HI

we dig into google to find solution.

we need to upload fonts to oracle jvm.

which fonts ur using either system fonts or jre fonts.

any suggestions on this.

Thanks & regards

Ranjith.

Hi,

What is your OS and runtime environment? We use standard Java fonts.
Thank you.

hi

we are using linux OS.

we trying to generate excel from oracle jvm.

can you tell me where can i get java fonts?

Thanks & regards

Ranjith kumar.





Hi,
We use java.awt.Font in general that is used in Java application in the common way. To measure the width/height of cells’ content, we use java.awt.Font and java.awt.FontMetrics as following:
java.awt.Font font = new java.awt.Font(name, style, size);
new JLabel().getFontMetrics(font);
...
Please try this simple code (with the fonts used in your template file) in your environment without any reference to Aspose.Cells. If it can work, then auto-fit function should work fine too.
Thank you.

Hello Ranjithv

please try the follow way , maybe it can help you to solve the question:

for Redhat Linux , I suggest you to run the follow command

Terminal

yum install liberation-fonts

for other linux product , maybe you can follow the article:

`http://ubuntu-tutorials.com/2007/10/30/installing-redhats-free-liberation-fonts`