0

I am using FOP to tranform xml to pdf, and I need to use Chinese characters.I did do something to use Chinese font,but it seems don't work at all. I create the font xml file.

enter image description here

and registered in the fop.xconf

<font metrics-url="/home/zhufree/Tools/fop-2.1/conf/simkai.xml" kerning="yes" embed-url="/home/zhufree/Tools/fop-2.1/conf/kaiti.ttf">
   <font-triplet name="simkai" style="normal" weight="normal" />
   <font-triplet name="simkai" style="normal" weight="bold" />
   <font-triplet name="simkai" style="italic" weight="normal" />
   <font-triplet name="simkai" style="italic" weight="bold" />
</font>

the font xml file and font ttf file are in the same directory with fop.xconf,when I try to transform,it still show me cant find the font.

enter image description here

What should I do to show the Chinese character?

Update: I solved the problem by using specific configuration file in java code, and it worked well.Thanks.

ksokol
  • 7,099
  • 3
  • 38
  • 54
zhufree
  • 21
  • 6
  • Supposing you set `font-family="simkai"` in a suitable position, so that it applies to your chinese text, it seems **you are not telling FOP to use your configuration file**: you should call it with the `-c` parameter, for example: `fop -c /path/to/your/fop.xconf test.fo test.pdf` (by the way, if you are using a recent version of FOP the xml metrics file is not needed any more) – lfurini Jan 20 '16 at 08:50
  • Possible duplicate of [Apache FOP Displaying ### with SunSim](http://stackoverflow.com/questions/25895984/apache-fop-displaying-with-sunsim) – lfurini Jan 20 '16 at 08:51
  • Can you share portion of your configuration java code and post it as an answer? – Boris Treukhov Jun 30 '16 at 20:49

0 Answers0