Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Fonts in PDF Report
Fonts in PDF Report [message #672062] Thu, 19 May 2011 18:28 Go to next message
Maria K. is currently offline Maria K.Friend
Messages: 4
Registered: May 2011
Junior Member
Hello to all.

I kindly request your help and your insight on the following issue:
I am using BIRT engine to generate reports in a web application hosted on JBoss Server. All reports are generated successfully, without any error.
I needed to change the font in the generated pdf report file, so I followed your recommendations regarding the fontConfig.xml file.
-I kept all info intact, and I only changed the font-paths contents: I removed all and added only one font path, that pointed to a registered ttf file.
-I removed all other fontsConfig-xxx.xml files.

The font I wanted never appeared. Times New Roman was used instead (as I have understood by looking at the source code, this is the default font).

Why is this happening? what I am doing wrong?

If you need any more info, I'll be happy to provide further details.
Re: Fonts in PDF Report [message #672156 is a reply to message #672062] Fri, 20 May 2011 05:58 Go to previous messageGo to next message
Maria K. is currently offline Maria K.Friend
Messages: 4
Registered: May 2011
Junior Member
More information:
The folder containing the fontsConfig.xml file is the following:
org.eclipse.birt.report.engine.fonts_2.5.1.v20090821
Re: Fonts in PDF Report [message #672267 is a reply to message #672156] Fri, 20 May 2011 13:31 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You did not need to remove the other paths. Are you getting anything in
the log file?

Jason

On 5/20/2011 1:58 AM, Maria K. wrote:
> More information:
> The folder containing the fontsConfig.xml file is the following:
> org.eclipse.birt.report.engine.fonts_2.5.1.v20090821
Re: Fonts in PDF Report [message #682050 is a reply to message #672267] Fri, 10 June 2011 09:55 Go to previous messageGo to next message
Maria K. is currently offline Maria K.Friend
Messages: 4
Registered: May 2011
Junior Member
Yes.. I'm getting the following exception:

Caused by: java.lang.NullPointerException: Failed to create Times-Roman which is not allow
at org.eclipse.birt.report.engine.layout.pdf.font.FontHandler.getMappedFont(FontHandler.java:244)
at org.eclipse.birt.report.engine.layout.pdf.font.FontHandler.selectFont(FontHandler.java:162)
at org.eclipse.birt.report.engine.layout.pdf.font.FontSplitter.buildChunk(FontSplitter.java:82)
at org.eclipse.birt.report.engine.layout.pdf.font.FontSplitter.getNext(FontSplitter.java:173)
at org.eclipse.birt.report.engine.layout.pdf.text.ChunkGenerator.getNext(ChunkGenerator.java:104)
at org.eclipse.birt.report.engine.nLayout.area.impl.TextCompositor.getNextTextArea(TextCompositor.java:146)
at org.eclipse.birt.report.engine.nLayout.area.impl.TextCompositor.getNextArea(TextCompositor.java:109)
at org.eclipse.birt.report.engine.nLayout.area.impl.TextAreaLayout.layoutChildren(TextAreaLayout.java:181)
at org.eclipse.birt.report.engine.nLayout.area.impl.TextAreaLayout.layout(TextAreaLayout.java:172)
at org.eclipse.birt.report.engine.nLayout.area.impl.BlockTextArea.layout(BlockTextArea.java:68)
at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startContent(LayoutEngine.java:459)
at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startText(ContentEmitterAdapter.java:147)
at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startLabel(ContentEmitterAdapter.java:153)
at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startLabel(CompositeContentEmitter.java:282)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startContent(HTMLTableLayoutEmitter.java:146)
at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startText(ContentEmitterAdapter.java:147)
at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startLabel(ContentEmitterAdapter.java:153)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:65)
at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.startContent(HTMLPageBuffer.java:116)
at org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.startContent(TableBreakBuffer.java:286)
at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:67)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:136)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:137)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:111)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:160)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:137)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:67)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:137)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:132)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:137)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:99)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:170)
... 83 more

Why is not possible to have a true type font of my choice, for PDF Rendering? (I have successfully created PDFs in any font I wanted, using directly itext).
Re: Fonts in PDF Report [message #682196 is a reply to message #682050] Fri, 10 June 2011 15:20 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Maria,

I just tested this with 2.6.2 and it worked fine. I downloaded a ttf
font put it in a directory on my c driver and then added a path to it at
the top of the font-paths tag in the fontsConfig.xml. The report ran
and used the font. I removed the font path and it the report reverted
to the default font.

<font-paths>
<path path="C:/work/styles/BaroqueScript" />
<path path="C:/windows/fonts" />
<path path="d:/windows/fonts" />
<path path="e:/windows/fonts" />
<path path="f:/windows/fonts" />
<path path="g:/windows/fonts" />
<path path="C:/WINNT/fonts" />
<path path="d:/WINNT/fonts" />

Jason


On 6/10/2011 5:55 AM, Maria K. wrote:
> Yes.. I'm getting the following exception:
>
> Caused by: java.lang.NullPointerException: Failed to create Times-Roman
> which is not allow
> at
> org.eclipse.birt.report.engine.layout.pdf.font.FontHandler.getMappedFont(FontHandler.java:244)
>
> at
> org.eclipse.birt.report.engine.layout.pdf.font.FontHandler.selectFont(FontHandler.java:162)
>
> at
> org.eclipse.birt.report.engine.layout.pdf.font.FontSplitter.buildChunk(FontSplitter.java:82)
>
> at
> org.eclipse.birt.report.engine.layout.pdf.font.FontSplitter.getNext(FontSplitter.java:173)
>
> at
> org.eclipse.birt.report.engine.layout.pdf.text.ChunkGenerator.getNext(ChunkGenerator.java:104)
>
> at
> org.eclipse.birt.report.engine.nLayout.area.impl.TextCompositor.getNextTextArea(TextCompositor.java:146)
>
> at
> org.eclipse.birt.report.engine.nLayout.area.impl.TextCompositor.getNextArea(TextCompositor.java:109)
>
> at
> org.eclipse.birt.report.engine.nLayout.area.impl.TextAreaLayout.layoutChildren(TextAreaLayout.java:181)
>
> at
> org.eclipse.birt.report.engine.nLayout.area.impl.TextAreaLayout.layout(TextAreaLayout.java:172)
>
> at
> org.eclipse.birt.report.engine.nLayout.area.impl.BlockTextArea.layout(BlockTextArea.java:68)
>
> at
> org.eclipse.birt.report.engine.nLayout.LayoutEngine.startContent(LayoutEngine.java:459)
>
> at
> org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startText(ContentEmitterAdapter.java:147)
>
> at
> org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startLabel(ContentEmitterAdapter.java:153)
>
> at
> org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startLabel(CompositeContentEmitter.java:282)
>
> at
> org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:65)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startContent(HTMLTableLayoutEmitter.java:146)
>
> at
> org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startText(ContentEmitterAdapter.java:147)
>
> at
> org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startLabel(ContentEmitterAdapter.java:153)
>
> at
> org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:65)
>
> at
> org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.startContent(HTMLPageBuffer.java:116)
>
> at
> org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.startContent(TableBreakBuffer.java:286)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:67)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:136)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:137)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:111)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:160)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:137)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:67)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:137)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:132)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:137)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:99)
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:170)
>
> ... 83 more
>
> Why is not possible to have a true type font of my choice, for PDF
> Rendering? (I have successfully created PDFs in any font I wanted, using
> directly itext).
Re: Fonts in PDF Report [message #683204 is a reply to message #682196] Mon, 13 June 2011 08:16 Go to previous messageGo to next message
Maria K. is currently offline Maria K.Friend
Messages: 4
Registered: May 2011
Junior Member
Thx Jason !

a question though:

you added the following path, first in the <font-paths> tag:
<path path="C:/work/styles/BaroqueScript" />

Is there a reason that you didn't write <path path="C:/work/styles/BaroqueScript.ttf" /> ??
Should the extension be omitted?
I suppose BaroqueScript is not mentioned anywhere else in the fontsConfig.xml file.
Did you register this font in Windows, before using it?

[Updated on: Mon, 13 June 2011 08:17]

Report message to a moderator

Re: Fonts in PDF Report [message #683309 is a reply to message #683204] Mon, 13 June 2011 13:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

My BaroqueScript.ttf was located in this directory:
C:/work/styles/BaroqueScript/BaroqueScript.ttf

The config file can use search directories. When I downloaded this font
I copied it to my windows fonts directory designed a report that used
it, then shut down the designer, deleted the font from the windows
directory and put it in the above directory. I modified the fonts
config as shown in previous post and ran the report in my deployed env.

Jason


On 6/13/2011 4:16 AM, Maria K. wrote:
> Thx Jason !
>
> a question though:
>
> you added the following path, first in the <font-paths> tag:
> <path path="C:/work/styles/BaroqueScript" />
>
> Is there a reason that you didn't write "<path
> path="C:/work/styles/BaroqueScript.ttf" /> ??
> Should the extension be omitted?
> I suppose BaroqueScript is not mentioned anywhere else in the
> fontsConfig.xml file. Did you register this font in Windows, before
> using it?
Re: Fonts in PDF Report [message #740268 is a reply to message #683309] Tue, 18 October 2011 10:26 Go to previous message
harip kaligo is currently offline harip kaligoFriend
Messages: 74
Registered: July 2011
Member
Hi,

I have a similar issue with PDF fonts. We are using birt3.7. It works fine in windows, but when deployed in linux we are getting Times New roman as default.
What settings need to be done, to make the pdf use Arial.

In linux, we do not have any fonts installed.

Any help regarding this is appreciated.

Thanks.
Hari Priya

[Updated on: Tue, 18 October 2011 10:30]

Report message to a moderator

Previous Topic:Heat map in birt
Next Topic:Calling back into the application from a report in RCP
Goto Forum:
  


Current Time: Thu Apr 18 06:27:17 GMT 2024

Powered by FUDForum. Page generated in 0.03052 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top