【问题标题】:Specifying a custom font指定自定义字体
【发布时间】:2019-02-21 12:53:11
【问题描述】:

有没有办法在我的 XSL-FO 样式表中指定自定义字体(即未安装在 Windows/Fonts 文件夹中的字体)?

在 CSS 中,你可以这样做:

@font-face {
    font-family: OpenSans;
    src: url(OpenSans-Regular.ttf);
}

在 XSL-FO 中是否有类似的可能?

我查看了 Antennahouse Formatter 文档。 AHF 允许您在字体配置文件中指定自定义字体文件夹,但这是一个系统范围的文件。我想为单个样式表设置字体而不影响其他样式表。

【问题讨论】:

    标签: xsl-fo antenna-house


    【解决方案1】:

    在fo:declarations 中添加axf:font-face(参见https://www.antennahouse.com/product/ahf66/ahf-ext.html#axf.font-face)。

    文档中的示例是:

    <fo:declarations>
      <axf:font-face src="url('http://www.hixie.ch/resources/fonts/AHEM____.TTF')"
                     font-family="AHEM"/>
    </fo:declarations>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-20
      • 1970-01-01
      • 2018-04-16
      • 2017-10-13
      • 2018-04-30
      • 2012-04-23
      相关资源
      最近更新 更多