6

I've created a rptdesign file using BIRT IDE. This file contents are in Arial font, when I export the report to PDF in windows it works fine.

I uses the default viewerServlet to create reports. But when I moved the report to a linux system, all contents in the report was displayed in Times New Roman font instead of Arial in th PDF file.

Then I copied the Arial.ttf file to /var/font/truetype and added the following line to platform/plugins/org.eclipse.birt.report.engine.fonts_2.3.2.r232_20090202/fontsConfig.xml

    <font-paths>
        ---------------
        ---------------
        ---------------
        <path path="/var/font/truetype" />
    </font-paths>

After adding this line all contents are coming in Arial font, but the contents which are bold appears to compressed and look very ugly.

Has anyone faced this problem and has any solution?

Thank you Regards, Arun

OregonGhost
  • 23,359
  • 7
  • 71
  • 108
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531
  • I don't know your particular framework, but doesn't it offer the possibility of embedding the used fonts into the PDF? – balpha Jun 29 '09 at 12:22

5 Answers5

2

Here is my fontsConfig_pdf.xml file

<font>
<font-aliases>
    <mapping name="sans-serif" font-family="Arial" />
    <mapping name="serif" font-family="Times-Roman" />
    <mapping name="monospace" font-family="Courier" />
</font-aliases>
<font-encodings>
    <encoding font-family="Times-Roman" encoding="Cp1252" />
    <encoding font-family="Helvetica" encoding="Cp1252" />
    <encoding font-family="Courier" encoding="Cp1252" />
    <encoding font-family="Zapfdingbats" encoding="Cp1252" />
    <encoding font-family="Symbol" encoding="Cp1252" />
    <encoding font-family="STSong-Light" encoding="UniGB-UCS2-H" />
    <encoding font-family="STSongStd-Light" encoding="UniGB-UCS2-H" />
    <encoding font-family="MHei-Medium" encoding="UniCNS-UCS2-H" />
    <encoding font-family="MSung-Light" encoding="UniCNS-UCS2-H" />
    <encoding font-family="MSungStd-Light" encoding="UniCNS-UCS2-H" />
    <encoding font-family="HeiseiMin-W3" encoding="UniJIS-UCS2-H" />
    <encoding font-family="HeiseiKakuGo-W5" encoding="UniJIS-UCS2-H" />
    <encoding font-family="KozMinPro-Regular" encoding="UniJIS-UCS2-H" />
    <encoding font-family="HYGoThic-Medium" encoding="UniKS-UCS2-H" />
    <encoding font-family="HYSMyeongJo-Medium" encoding="UniKS-UCS2-H" />
    <encoding font-family="HYSMyeongJoStd" encoding="UniKS-UCS2-H" />
</font-encodings>
<font-paths>
        <path path="/var/fonts/truetype"/>
</font-paths>
<composite-font name="all-fonts">
    <font font-family="Times-Roman" catalog="Western" />
    <font font-family="MSung-Light" catalog="Chinese" />
    <font font-family="HeiseiKakuGo-W5" catalog="Japanese" />
    <font font-family="HYGoThic-Medium" catalog="Korean" />
</composite-font>
</font>
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531
0

Try explicitly stating your path to the font like this:

<font-paths>
   <path path="/var/font/truetype/arial.ttf" />
</font-paths>

Setting this property (font-paths) cause the default fonts directory to be ignored in favor of only the paths in this set. This will make Arial the only available font for your PDF. To include the default fonts (TNR, Courier, etc...) add the default path (org.eclipse.birt.report.engine.fonts) under the eclipse plug-ins to you font-paths entries as well.

You can also choose to just add Arial.ttf to the default directory and REMOVE ALL ENTRIES from font-paths and pick up the Arial type that way. Either way should work.

Good Luck.

MystikSpiral
  • 5,018
  • 27
  • 22
  • After doing this also the bold characters are appearing very bold and compressed. I think it is same as the including the font folder. Instead of loading all the fonts it will load only the Arial font. – Arun P Johny Jun 30 '09 at 05:19
  • Arial.ttf has a bold variant in the font itself. As long as the font class is being found, it is the PDF engine that is having trouble handling the bold weight. – MystikSpiral Jun 30 '09 at 13:56
  • Do you know where fontsConfig.xml lives in the BIRT (4.3.2) runtime? – Kevin Rahe Mar 25 '22 at 05:04
0

Can any one tell me if there is any issue with Arial font in linux, if the characters are set as bold

Everything works fine for us. Below is my patch for fontsConfig.xml:

<font-aliases>
    <mapping name="sans-serif" font-family="Arial" />
    ...
</font-aliases>
<font-paths>
    <path path="fonts"/>
</font-paths>

Put in fonts folder arial.ttf and arial.xml files.

FoxyBOA
  • 5,788
  • 8
  • 48
  • 82
  • Hi, Thanks for your answer. But it is still not working for me. I've added the font-aliases and font-paths in fontsConfig_pdf.xml file. Can you tell me any how the bolded text in your reports works, is it looks ok? – Arun P Johny Jul 07 '09 at 12:44
  • Yes. Bold Arial looks fine. Did you have multiple fontsConfig files? I recommend you (if it possible) leave 1 file fontsConfig.xml and configure everything in the file. – FoxyBOA Jul 07 '09 at 13:32
0

I spent hours searching for this:

export BIRT_FONT_PATH=/usr/share/fonts/truetype

Execute this and done!

Tim Zimmermann
  • 6,132
  • 3
  • 30
  • 36
0

Then I copied the Arial.ttf file to /var/font/truetype

Arial.ttf only contains the plain version of the font. For bold, italic and italic-bold there are different files (arialbd.ttf etc). Just copy these, too.

hvb
  • 2,484
  • 1
  • 10
  • 13