Hello,
I've got problem starting iReport-Designer if there are TTC-Fonts (e.g. simsun.ttc) in the fonts directory. The splash-screen hangs (loading fonts) and I've got this exception:
Any ideas to fix the problem?
Regards
Marcus
I've got problem starting iReport-Designer if there are TTC-Fonts (e.g. simsun.ttc) in the fonts directory. The splash-screen hangs (loading fonts) and I've got this exception:
Exception in thread "main" java.lang.NullPointerException at com.lowagie.text.pdf.DefaultFontMapper.pdfToAwt(DefaultFontMapper.java:185) at it.businesslogic.ireport.FontListLoader.loadTTFFonts(FontListLoader.java:112) at it.businesslogic.ireport.gui.MainFrame.<init>(MainFrame.java:378) at it.businesslogic.ireport.gui.MainFrame.main(MainFrame.java:7110) |
Any ideas to fix the problem?
Regards
Marcus
3 Answers:
Posted on July 21, 2006 at 6:01am
Hi Giulio,
the font is still ok (tested with other applications like apache fop). iText might be a problem. I've tried to fix the problem also but had no idea left :( Using a new version of iText (1.4.2) does not help.
Please correct the FontListLoader so that the iReport designer does not hang up if loading a ttc font:
Thanks
Marcus
the font is still ok (tested with other applications like apache fop). iText might be a problem. I've tried to fix the problem also but had no idea left :( Using a new version of iText (1.4.2) does not help.
Please correct the FontListLoader so that the iReport designer does not hang up if loading a ttc font:
com.lowagie.text.pdf.BaseFont bf = com.lowagie.text.FontFactory.getFont( file.getPath() + file.separator + files).getBaseFont(); if (bf != null) { java.awt.Font f = fontMapper.pdfToAwt(bf, 10); |
Thanks
Marcus
Posted on September 26, 2006 at 12:45pm
I've found a solution for the problem! You have to create the BaseFont another way:
OLD:
NEW:
I guess the problem is the encoding of the ttc-file. While reading the ttc with parameter IDENTITY_H opens the font correctly.
Hope that helps
Marcus
OLD:
com.lowagie.text.pdf.BaseFont bf = com.lowagie.text.FontFactory.getFont( file.getPath() + file.separator + files).getBaseFont(); |
NEW:
com.lowagie.text.pdf.BaseFont bf = com.lowagie.text.pdf.BaseFont.createFont(file.getPath() + file.separator + files + "," + a, com.lowagie.text.pdf.BaseFont.IDENTITY_H, com.lowagie.text.pdf.BaseFont.EMBEDDED); |
I guess the problem is the encoding of the ttc-file. While reading the ttc with parameter IDENTITY_H opens the font correctly.
Hope that helps
Marcus