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

219 views Asked by At

I need help again. I'm almost done with my idea and actually just need some fine tuning of my bible. Is it possible that the chapter number stand as drop cap? Here is an example from another bible: https://i.stack.imgur.com/1uRTp.png

The link for the the editing code: https://xsltfiddle.liberty-development.net/nb9PtDi/118

Thank you very much!

2

There are 2 answers

1
Kevin Brown On BEST ANSWER

Just use floats, they should work with FOP. The structure you are looking to create should be something like this:

<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>

See http://www.renderx.com/usecasestest.html "creating drop capitals using side floats"

Used this test file and FOP 2.5, the result is:

enter image description here

There is no need for any extensions to any FO formatter to accomplish this, as long as they support floats.

2
Tony Graham On

https://xsltfiddle.liberty-development.net/nb9PtDi/120 uses fo:float rather than the AH Formatter extension for initial capitals. This works in AH Formatter (see below), but a fresh install of FOP 2.6 stops after the floated '1', and the FOP used by xsltfiddle.liberty-development.net loses the floated chapter numbers. Maybe you can make it work with FOP, since FOP is supposed to be able to float to the left and right.

Sample showing dropped chapter numbers.

The size and position of the dropped numbers were determined by a bit of trial and error and are adequate for the font that I was using. You'd need to know the font metrics of the font that you are using to properly align the top of the number with the cap height of the first line and align the baseline of the number with the baseline of the second line.