AsciidocFX编辑器小贴士

I. AsciidocFX支持UML生成:

要生成UML,记得要下载GRAPHVIZ,并配置GRAPHVIZ_DOT环境变量,路径是Graphviz\bin\dot.exe。

II. AsciidocFX生成中文PDF文件时,可能会出现如下两个问题:

1.页眉中的中文解析成###,无法正确解析。原因:没有配置合适的Unicode字体。

2.二级以下的标题无法正确解析中文,中文全部变成###。原因:中文字体无法同时支持 加粗+斜体 的样式。

AsciidocFX使用了FOP来生成pdf,而FOP对中文的支持并不十分完善,引用 http://www.blogjava.net/scud/ 中的描述如下:

FOP 0.20.5功能相对还是比较弱,例如

1.不支持多种字体的组合,也就是不支持font-family="sans-serif,宋体"这种方式,
结果就是每段都要指定,否则就只能用一种了,对于confluence来说就很不好了…

2.不支持程序处理斜体,黑体,这样就要求字体支持黑体,斜体才能实现黑体斜体的效果.
结果就是中文字体都没有黑体,斜体,无法直接实现中文的黑体,斜体了

对应上述问题,需要在AsciidocFX\conf\docbook-config\fo-pdf.xsl中修改生成样式——修改两个地方即可解决。

第一个地方原文:

    <xsl:attribute-set name="header.content.properties">
        <xsl:attribute name="font-family">Sans-serif,Arial</xsl:attribute>
        <xsl:attribute name="font-size">8pt</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="footer.content.properties">
        <xsl:attribute name="font-family">Sans-serif,Arial</xsl:attribute>
        <xsl:attribute name="font-size">8pt</xsl:attribute>
    </xsl:attribute-set>

修改:

    <xsl:attribute-set name="header.content.properties">
        <xsl:attribute name="font-family">Arial Unicode MS,Sans-serif,Arial</xsl:attribute>
        <xsl:attribute name="font-size">8pt</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="footer.content.properties">
        <xsl:attribute name="font-family">Arial Unicode MS,Sans-serif,Arial</xsl:attribute>
        <xsl:attribute name="font-size">8pt</xsl:attribute>
    </xsl:attribute-set>

第二个地方原文:

    <xsl:attribute-set name="section.title.level1.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level2.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <xsl:attribute name="font-style">italic</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level3.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <xsl:attribute name="font-style">italic</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level4.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <xsl:attribute name="font-style">italic</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level5.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <xsl:attribute name="font-style">italic</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level6.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <xsl:attribute name="font-style">italic</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

修改:

    <xsl:attribute-set name="section.title.level1.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level2.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <!-- <xsl:attribute name="font-style">italic</xsl:attribute> -->
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level3.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <!-- <xsl:attribute name="font-style">italic</xsl:attribute> -->
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level4.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <!-- <xsl:attribute name="font-style">italic</xsl:attribute> -->
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level5.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <!-- <xsl:attribute name="font-style">italic</xsl:attribute> -->
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="section.title.level6.properties">
        <xsl:attribute name="font-size">12pt</xsl:attribute>
        <!-- <xsl:attribute name="font-style">italic</xsl:attribute> -->
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值