xsl-fo - 指定自定义字体
问题描述
有没有办法在我的 XSL-FO 样式表中指定自定义字体(即未安装在 Windows/Fonts 文件夹中的字体)?
在 CSS 中,您可以这样做:
@font-face {
font-family: OpenSans;
src: url(OpenSans-Regular.ttf);
}
XSL-FO 中是否有类似的可能?
我检查了 Antennahouse Formatter 文档。AHF 允许您在字体配置文件中指定自定义字体文件夹,但这是一个系统范围的文件。我想为单个样式表设置字体而不影响其他样式表。
解决方案
在里面添加axf:font-face
(见https://www.antennahouse.com/product/ahf66/ahf-ext.html#axf.font-face)fo:declarations
。
文档中的示例是:
<fo:declarations>
<axf:font-face src="url('http://www.hixie.ch/resources/fonts/AHEM____.TTF')"
font-family="AHEM"/>
</fo:declarations>
推荐阅读
- .net-core - 从异步方法返回字符串
- java - 无法通过 Apache commons csv 读取超过记录
- javascript - 在 REACT JS 中将活动类动态添加到多级侧边栏菜单
- c# - 在 C# 中按地址调用非托管 fastcall C 函数
- sql - 将查询结果从结构转换为另一个 Golang 包的字符串
- react-router - React Router - 不会在表单提交时自动路由
- css - 如何修复填充以实现移动兼容性?
- hyperledger-fabric - 如何使用 fabric-ca 生成 tls 证书和密钥
- python-3.x - 使用 scipy 在 python 中对多维数组进行插值。
- sql - SQL 查询以获取 tab2 中每个 EID 和 JOINING_DT 对应的记录,这些记录是 tab2 中的前一个、相等日期和所有更大的日期行