Embedded font don't work in Apache FOP

为君一笑 提交于 2020-01-07 03:52:23

问题


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.

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.

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.

来源:https://stackoverflow.com/questions/34878051/embedded-font-dont-work-in-apache-fop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!