[#4723] - Exception in thread "main" net.sf.jasperreports.engine.util.JRFontNotFoundException

Category:
Bug report
Priority:
High
Status:
Closed
Project: Severity:
Major
Resolution:
No Change Required
Component: Reproducibility:
Always
Assigned to:
0

Hi, we have a JAVA program that converts .jasper to .pdf. We a have a new font and it is in a jar, its name is fuentes.jar.

When We execute the program, it returns the next error:

Exception in thread "main" net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Charlotte Sans Book LET' is not available to the JVM. See the Javadoc for more details.
at net.sf.jasperreports.engine.util.JRFontUtil.checkAwtFont(JRFontUtil.java:339)
at net.sf.jasperreports.engine.util.JRStyledText.getAwtAttributedString(JRStyledText.java:226)
at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:362)
at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:1129)
at net.sf.jasperreports.engine.fill.JRFillTextField.prepare(JRFillTextField.java:554)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummaryNoLastFooterSamePage(JRVerticalFiller.java:1067)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:1030)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:300)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:134)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:938)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)
at net.sf.jasperreports.engine.JasperRunManager.runReportToPdfFile(JasperRunManager.java:122)
at biz.bluemat.pdf.Utilidades.jasperPDF(Utilidades.java:58)
at biz.bluemat.ejecucion.Informes.generarInformeGlobal(Informes.java:95)
at biz.bluemat.ejecucion.Informes.main(Informes.java:293)

How do we fix this problem?

Thank you very much.

AttachmentSize
File fuentes.jar51.67 KB
Binary Data pruebaDani.jrxml7.79 KB
martinfdan's picture
Joined: May 12 2010 - 11:39pm
Last seen: 9 years 9 months ago

11 Comments:

#1

Hi, this problem has fixed. We have created a jar with iReport export.

We see the solution here: http://stage.jasperforge.org/plugins/espforum/view.php?group_id=102&foru...

But We have a new problem:

Exception in thread "main" net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font :
pdfFontName : Charsnw_.ttf
pdfEncoding : Cp1252
isPdfEmbedded : false
at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:1895)
at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:1705)
at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1681)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:2114)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:769)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:729)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:609)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:378)
at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:122)
at net.sf.jasperreports.engine.JasperRunManager.runReportToPdfFile(JasperRunManager.java:124)
at biz.bluemat.pdf.Utilidades.jasperPDF(Utilidades.java:58)
at biz.bluemat.ejecucion.Informes.generarInformeGlobal(Informes.java:95)
at biz.bluemat.ejecucion.Informes.main(Informes.java:293)

Wait your response.

Regards.

#2

Hi,

Can you upload here the JRXML file and the font extension JAR that you created with iReport?

Thank you,
Teodor

#3

I uploaded the JRXML file (pruebaDani) and the font.jar file

Thanks for you help!

#4

Hi,

If you have packed your TTFs in a font extension JAR, there is no reason for using the pdfFontName attributes in your JRXML.
Please remove them and make sure text fields have fontName, or have the fontName be inherited from a report default style.
Note that the three attributes pdfFontName, pdfEncoding, and isPdfEmbedded are now deprecated (replaced by settings inside font extensions).

I have tested your report and font extension JAR with iReport and it worked. Are you sure your font extension JAR is in the classpath at the time the PDF export is performed?
Is the PDF export occurring inside the same application that does the report filling?

Thank you,
Teodor

#5

Hi,

Anything new on this one?

Thank you,
Teodor

#6

Its solved! Thanks!

#7

Hi, What is the fix for this issue? I am getting below error on ireports version 3.7.4

Error filling print... Font 'Helvetica' is not available to the JVM. See the Javadoc for more details.
net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Helvetica' is not available to the JVM. See the Javadoc for more details.      at net.sf.jasperreports.engine.util.JRFontUtil.checkAwtFont(JRFontUtil.java:358)      at net.sf.jasperreports.engine.util.JRStyledText.getAwtAttributedString(JRStyledText.java:226)      at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:362)      at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:1129)      at net.sf.jasperreports.engine.fill.JRFillTextField.prepare(JRFillTextField.java:554)      at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)      at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419)      at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2028)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:757)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:269)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:127)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841)      at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:608)      at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)      at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205)      at java.lang.Thread.run(Unknown Source) 
Print not filled. Try to use an EmptyDataSource...

#8
  • Resolution:Reopened» No Change Required
  • Status:Feedback Requested» Closed

Hi,

You should do what the exception says: read the Javadoc:
http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/uti...

I hope this helps.
Teodor

#9
  • Status:Closed» New
  • Assigned:nobody»

Exception in thread "main" net.sf.jasperreports.engine.util.JRFontNotFoundException: Font "Arundina Sans" is not available to the JVM. See the Javadoc for more details.
at net.sf.jasperreports.engine.fonts.FontUtil.checkAwtFont(FontUtil.java:604)
at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.loadFont(SimpleTextLineWrapper.java:384)
at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.getGeneralFontInfo(SimpleTextLineWrapper.java:354)
at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.createFontInfo(SimpleTextLineWrapper.java:294)
at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.start(SimpleTextLineWrapper.java:256)
at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:543)
at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:665)
at net.sf.jasperreports.engine.fill.JRFillStaticText.prepare(JRFillStaticText.java:179)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:542)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:453)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:428)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2585)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:813)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:264)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615)
at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:432)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:162)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:145)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:758)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:1074)
at de.cenote.jasperstarter.Report.fillInternal(Report.java:306)
at de.cenote.jasperstarter.Report.fill(Report.java:282)
at de.cenote.jasperstarter.App.processReport(App.java:226)
at de.cenote.jasperstarter.App.main(App.java:109)

Hi All,
I am getting the above error.Please help me on this

#10
  • Status:New» Feedback Requested
  • Assigned:nobody» teodord

Tarun,

Are you saying the you followed what the error was telling you to do (read the Javadoc) and still do not know how to solve it?
http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/uti...
I'm afraid there is nothing much I could add besides what the Javadoc says.

Thank you,
Teodor

#11
  • Status:Feedback Requested» Closed
Feedback
randomness