tags:

views:

28

answers:

2

I'm using FOP to generate PDF reports. The problem is I need the DIN-Regular font instead of the default Times New Roman. Can anybody tall me how to change the font? I'm using fop-0.94.boc.02 version. Thanks

A: 

All you have to do is register the font and it's location in your config file, fop.xconf.

Like so:

<fonts>

  <directory>/usr/share/fonts/TTF</directory>  
  <font-triplet name="DIN-Regular" style="normal" weight="bold"/>

(...)

</fonts>

In your FOP code you should refer the font like so:

<fo:block font-size="11.5pt" font-family="DIN-Regular"> Content
</fo:block>

Currently FOP supports only TrueType fonts correctly, I think.

You also have to take a look at the style of the font, in order to include it in your triplet. Do this by opening and investigating your font.

Make sure to include -c fop.xconf when you call fop and you should be good to go!

Fred Rocha
A: 

Although the ttf fonts like DINRg, Arial, ... have all the codepages, fop prints only characters in the first (=Latin 1 ) page. Greek and other languages, although existing in the font, cannot be printed in fop. This is a major drawback. Has anyone any idea how to convince fop to access and print the glyphs of the other pages other than Latin 1?

sjpapa