zoukankan      html  css  js  c++  java
  • AsciidocFX编辑器小贴士

    I. AsciidocFX支持UML生成:

    要生成UML,记得要下载GRAPHVIZ,并配置GRAPHVIZ_DOT环境变量,路径是Graphvizindot.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.不支持程序处理斜体,黑体,这样就要求字体支持黑体,斜体才能实现黑体斜体的效果.
        结果就是中文字体都没有黑体,斜体,无法直接实现中文的黑体,斜体了

    对应上述问题,需要在AsciidocFXconfdocbook-configfo-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>
  • 相关阅读:
    【Collect】免费图片库网站推荐(国外高清可商用)
    "One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?"的解决方法
    "从客户端中检测到有潜在危险的 Request.Form 值"的解决方案汇总
    Fira Code:适合程序员的编程字体
    【Notepad++】notepad++主题和字体设置(非常好看舒服的)
    【sql server】"已更新或删除的行值要么不能使该行成为唯一行,要么改变了多个行" 解决方案
    【SQL】sql update 多表关联更新方法总结
    【C#】 List按指定字段的给出的自定义顺序进行排序
    3 常量与变量
    2 go语言的基础
  • 原文地址:https://www.cnblogs.com/prpl/p/6219943.html
Copyright © 2011-2022 走看看