我正在使用 Apache FOP 2.4 的 Web 应用程序中生成 PDF。使用表情符号生成 PDF 时,生成的 PDF 格式为###############。但正常的字母数字文本显示正确。 以下是我的渲染器在 fop.xconf 文件中的样子。
<renderers>
<renderer mime="application/pdf">
<filterList>
<value>flate</value>
</filterList>
<fonts>
<font embed-url="ARIAL.TTF">
<font-triplet name="Arial" style="normal" weight="normal"/>
</font>
<font embed-url="ARIALBD.TTF">
<font-triplet name="Arial" style="normal" weight="bold"/>
</font>
<font embed-url="ARIALI.TTF">
<font-triplet name="Arial" style="italic" weight="normal"/>
</font>
<font embed-url="ARIALBI.TTF">
<font-triplet name="Arial" style="italic" weight="bold"/>
</font>
<font embed-url="ARIALUNI.TTF">
<font-triplet name="Arial Unicode MS" style="normal" weight="normal"/>
</font>
<font embed-url="NotoColorEmoji-Regular.ttf">
<font-triplet name="Noto Color Emoji" style="normal" weight="normal"/>
</font>
<font embed-url="MSGOTHIC.TTC" metrics-url="msgothic.xml">
<font-triplet name="Gothic" style="normal" weight="normal"/>
<font-triplet name="Gothic" style="normal" weight="bold"/>
<font-triplet name="Gothic" style="italic" weight="normal"/>
<font-triplet name="Gothic" style="italic" weight="bold"/>
</font>
</fonts>
</renderer>
</renderers>
我添加了 NotoColorEmoji-Regular.ttf 以支持表情符号。但我仍然无法正确获取 PDF 中的表情符号。 我已将所有字体文件添加到与 fop.xconf 文件相同的级别。 我该如何解决这个表情符号问题?