章节编号作为圣经的初始(首字母下沉?)(xsl-fo 和 xml 到 pdf)

Chapter-Number as initial (drop cap?) for bible (xsl-fo and xml to pdf)

我又需要帮助了。我几乎完成了我的想法,实际上只需要对我的圣经进行一些微调。 章节编号是否有可能作为首字下沉?这是另一本圣经的例子: https://i.stack.imgur.com/1uRTp.png

编辑代码link: 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 格式化程序进行任何扩展即可实现此目的,只要它们支持浮点数即可。