我对 DITA OT 很陌生。下载了 DITA-OT1.5.4_full_easy_install_bin 并使用它。我正在尝试将简体中文 (zh-CN) 中的几个字符打印到 PDF 中。我看到这些字符在 XHTML 中正确打印,但在 PDF 中它们打印为“#”。
在命令行中,我看到了这个 - “警告:字形“?”(0x611f)在字体“Helvetica”中不可用。以下是我迄今为止尝试过的事情:
在 demo\fo\fop\conf\fop.xconf :
<fonts>
<font kerning="yes"
embed-url="file:///C:/Windows/Fonts/simsun.ttc"
embedding-mode="subset" encoding-mode="cid">
<font-triplet name="SimSun" style="normal" weight="normal"/>
</font>
<auto-detect/>
<directory recursive="true">C:\Windows\Fonts</directory>
</fonts>
在 demo\fo\cfg\fo\attrs\custom.xsl :
<xsl:attribute-set name="__fo__root">
<xsl:attribute name="font-family">SimSun</xsl:attribute>
</xsl:attribute-set>
在 demo\fo\cfg\fo\font-mapping.xml 中为 Sans、Serif 和 Monospaced 逻辑字体添加了这个块:
<physical-font char-set="Simplified Chinese">
<font-face>SimSun</font-face>
</physical-font>
在 samples\concepts\garageconceptsoverview.xml 中:
<shortdesc xml:lang="zh_CN">職業道德感.</shortdesc>
这是我用来生成 PDF 的命令:
ant -Dargs.input=samples\hierarchy.ditamap -Dtranstype=pdf
任何帮助,将不胜感激。谢谢。
[编辑] 我看到在 temp 文件夹中生成的 topic.fo 文件确实包含正确的中文字符。像这样:
<fo:block font-size="10pt" keep-with-next.within-page="5" start-indent="25pt">職業道德感.</fo:block>
但我在本文档的任何地方都没有看到与字体相关的信息。