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>

优质内容筛选与推荐>>
1、jQuery插件之-Smart spin
2、实习记-1
3、链接与加载
4、linux tar.gz zip 解压缩 压缩命令
5、Windows ->> Windows Server 2012打开管理添加“我的电脑”桌面图标途径


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号





    联系我们

    欢迎来到TinyMind。

    关于TinyMind的内容或商务合作、网站建议,举报不良信息等均可联系我们。

    TinyMind客服邮箱:support@tinymind.net.cn