本文介绍了Apache FOP 和 Arial 字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的 XSL 样式使用 Arial 字体
My XSL style uses Arial font
<fo:block font-family="Arial" font-size="8pt" font-weight="normal">
配置文件fonts.xml:
Configuration file fonts.xml:
<?xml version="1.0"?>
<fop>
<renderers>
<renderer mime="application/pdf">
<fonts>
<base>file:///C:/windows/fonts</base>
</fonts>
</renderer>
</renderers>
</fop>
也尝试使用这个:
<auto-detect/>
和
<directory>C:\windows\fonts</directory>
我总是得到:
WARNING: Font "Arial,normal,400" not found. Substituting with "any,normal,400".
为了使用 Arial 字体,我应该解决什么问题?
What should I fix in order to use Arial font?
推荐答案
这对我有用,需要在配置文件中明确指定 Arial 字体:
This worked for me, need to specify the Arial font explicitly in configuration file:
<?xml version="1.0"?>
<fop>
<renderers>
<renderer mime="application/pdf">
<fonts>
<font kerning="yes" embed-url="file:///C:/windows/fonts/arial.ttf">
<font-triplet name="Arial" style="normal" weight="normal"/>
</font>
</fonts>
</renderer>
</renderers>
</fop>
这篇关于Apache FOP 和 Arial 字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!