问题描述
我又需要帮助了。我几乎完成了我的想法,实际上只需要对我的圣经进行一些微调。 章节号是否有可能作为首字下沉?这是另一部圣经中的一个例子: https://i.stack.imgur.com/1uRTp.png
编辑代码链接: https://xsltfiddle.liberty-development.net/nb9PtDi/118
非常感谢!
解决方法
https://xsltfiddle.liberty-development.net/nb9PtDi/120 使用 fo:float
而不是 AH Formatter 扩展名作为首字母大写。这适用于 AH Formatter(见下文),但 FOP 2.6 的全新安装在浮动的“1”后停止,并且 xsltfiddle.liberty-development.net 使用的 FOP 丢失了浮动的章节编号。也许你可以让它与 FOP 一起工作,因为 FOP 应该能够向左和向右浮动。
丢弃数字的大小和位置是通过反复试验确定的,对于我使用的字体来说已经足够了。您需要知道您使用的字体的字体规格,以便将数字的顶部与第一行的大写高度正确对齐,并将数字的基线与第二行的基线对齐。
,只需使用浮动,它们应该与 FOP 一起使用。您要创建的结构应该是这样的:
<fo:block>
<fo:float float="start">
<fo:block margin="0pt" color="red" text-depth="0pt" font-size="62pt" line-height="40pt" font-weight="bold" font-family="Courier">F</fo:block>
</fo:float>loats dimensions derived from its content width/height,accompanying text should wrap around floating block. Drop capital in this paragraph implemented using side float that contains fo:block with single big letter "F". Floats dimensions derived from its content width/height,accompanying text should wrap around floating block. Drop capital in this paragraph implemented using side float that contains fo:block with single big letter "F".
</fo:block>
参见http://www.renderx.com/usecasestest.html“使用侧浮标创建大写字母”
使用这个测试文件和FOP 2.5,结果是:
无需对任何 FO 格式化程序进行任何扩展即可完成此操作,只要它们支持浮点数即可。