BUG in Installing new Font in Jaspersoft Studio

0

update: even when I import a jar file genereated by the iReport it does not work. I think this is a bug with the Jasper Studio. 

update: attached is my jar file.

I am trying to install a new font in Jasper Studio (Arrial Narow) so that I can eventually print the report as a PDF docuemtn. Here are my steps:

Project Properties ->Fonts --> Configure Workspace settings ->Add->

  1. True Type : C:\tmp\ARIALN.TTF
  2. PDF Font Name : Left empty as none of the choices has arial narrow
  3. Embed this font in PDF doc : checked. 
  4. Everything else is default

Then applied my new font to a lable on my report and I keep getting this error:

java.lang.reflect.InvocationTargetException
at com.jaspersoft.studio.editor.preview.actions.export.AbstractExportAction$1.run(AbstractExportAction.java:122)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: net.sf.jasperreports.engine.JRRuntimeException: com.lowagie.text.DocumentException: Font '' with 'Cp1252' is not recognized.
at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:2062)
at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:1818)
at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1787)
at net.sf.jasperreports.engine.export.SimplePdfTextRenderer.getPhrase(SimplePdfTextRenderer.java:89)
at net.sf.jasperreports.engine.export.SimplePdfTextRenderer.render(SimplePdfTextRenderer.java:100)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:2158)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:861)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:821)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:698)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:420)
at com.jaspersoft.studio.editor.preview.actions.export.AbstractExportAction.exportWithProgress(AbstractExportAction.java:219)
at com.jaspersoft.studio.editor.preview.actions.export.AbstractExportAction$1.run(AbstractExportAction.java:119)
... 1 more
Caused by: com.lowagie.text.DocumentException: Font '' with 'Cp1252' is not recognized.
at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:2051)
... 12 more
Attachments: 
haidar_hadi_205's picture
Joined: May 14 2014 - 12:47pm
Last seen: 5 years 3 weeks ago

any idea from the Jasper staff?

haidar_hadi_205 - 5 years 1 month ago

3 Answers:

0
Hi Haidar, the Font extension you are using seems to work well, I was able to produce a report and export it to PDF without problems. May we see your jrxml? Thanks Giulio
giulio's picture
22226
Joined: Jan 2 2007 - 4:15pm
Last seen: 5 months 1 week ago

I was able to use the font inside the jar file you attached.
Haidar could you please open bug on the tracker? http://community.jaspersoft.com/bug-tracker?field_bug_project_target_id=496
Please remember to attach if possible the JRXML and also the version information about the JSS you are using.

Thanks in advance.
Regards,
Massimo.

mrabbi - 5 years 1 month ago

when you generate a PDF file does the font show in Arial Narrow ?

haidar_hadi_205 - 5 years 1 month ago

Also , are you using 5.5 Jaspersoft Studio Professional ?

haidar_hadi_205 - 5 years 1 month ago
0

There was a bug in 5.5.0 release with external fonts. Try using the most recent version 5.6.0.

hozawa's picture
44159
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 month 5 days ago

Thank you so much for answering this, where can I download 5.6.0 from? On the download page for the professional version there is only 5.5.0. Any idea?

haidar_hadi_205 - 5 years 1 month ago

If you have access to Jaspersoft Support portal, the recent download should be 5.6.0.
I'm not sure if 5.5.0a that is available at sourceforge fixes this problem or not.

5.6.0 release notes:
defect 35513 JasperReports Server 5.5 is unable to work with font extension file which contains CDATA tags
Defect 35665 Font Extensions do not work in JasperReports Server 5.5/HTML output

hozawa - 5 years 1 month ago
0

I have exporters to pdf, xls, and xlsx. I had this issue with pdf under 5.5.0 and the upgrade to 5.6.0 fixed the issue with the pdf font extensions. However, I am now having a simliar problem getting the font extensions to work using xlsx. It worked fine with 5.5.0 but is now broken with 5.6.0. Both versions export the fonts to xls correctly. Has anyone else reported this?

 

 

smakaiser's picture
Joined: May 8 2014 - 11:47am
Last seen: 3 years 10 months ago
Feedback