Closed mojavelinux closed 2 years ago
Experience has shown us that the abstractions in the converter are sufficient. At this point, we're not going to change it as it would have a rippling effect both on the behavior of the converter and the documents it produces. Plus, we were able to resolve the top padding on the line height when text is split across pages in 2.0.0.
Fonts in Asciidoctor PDF are tricky.
Prawn also doesn't provide a basic “line height” abstraction, so we had to shoehorn something into Asciidoctor PDF that mostly works. See: https://github.com/asciidoctor/asciidoctor-pdf/blob/master/lib/asciidoctor-pdf/prawn_ext/extensions.rb#L262-L283
I point these things out so there's an understanding that “font-size” and “line-height” in Asciidoctor PDF are a little kludgy at the moment.
I'd like to step back and do an analysis of how fonts and font metrics are being handled so that we can arrive at something a bit more sane that doesn't leak into the theme.
The easiest way to see the problem is to set the font-height to 1 and print some paragraphs in different fonts where the theme allows this control (paragraph, sidebar, example block, etc). You'll see that different fonts will leave different amounts of space between the lines. Atm, the default theme just “adjusts” to make due with these differences. But we can do better.