gpt4 book ai didi

java - Apache FOP 和 Arial 字体

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:28:39 25 4
gpt4 key购买 nike

我的 XSL 样式使用 Arial 字体

<fo:block font-family="Arial" font-size="8pt" font-weight="normal"> 

配置文件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 字体,我应该修复什么?

最佳答案

这对我有用,需要在配置文件中明确指定 Arial 字体:

<?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>

关于java - Apache FOP 和 Arial 字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16548090/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com