gpt4 book ai didi

xsl-fo - FOP 中的字体系列

转载 作者:行者123 更新时间:2023-12-01 04:11:29 25 4
gpt4 key购买 nike

我只是想知道,是否有可能在 FO 文件中命名几种替代字体?
我知道在 HTML 和 CSS 中是可能的,但是我找不到关于 XSL-FO 的任何信息。

像这样:

h1 {
font-family: arial, verdana, serif;
}

我的问题是,FOP 不能使用我的大部分字体,所以如果我能找到一种可能性,给 FOP 提供 3 个字体名称,然后在使用 Times New Roman 之前尝试使用所有字体名称,那就太好了。

谢谢你的帮助。

最佳答案

它的工作原理类似于 CSS ( although with FOP, it may not behave exactly the same )。 XSL-FO’s font-family property is specified as a list of font names, separated by commas, in order from first choice to last choice .

This property specifies a prioritized list of font family names and/or generic family names. To deal with the problem that a single font may not contain glyphs to display all the characters in a document, or that not all fonts are available on all systems, this property allows authors to specify a list of fonts, all of the same style and size, that are tried in sequence to see if they contain a glyph for a certain character. This list is called a font set.



FOP 可以通过多种方式配置以加载其他字体。 最简单的就是 set the auto-detect flag, and FOP will scan your system for installed fonts .

When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.

FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:

Manifest-Version: 1.0

      Name: font/myfont.ttf
Content-Type: application/x-font

This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.

关于xsl-fo - FOP 中的字体系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5923773/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com