[reportlab-users] Paragraph "Hack"

Paul Barrass paul.barrass at safeonlinebilling.com
Tue Oct 21 06:44:46 EDT 2008


Robin Becker wrote:

>

> The hack here was that when this change was first made we hadn't yet

> propagated the ascent attribute to XPreformatteds so f.ascent could fail.

>

Hi.

Thanks for your response. Do you know if this change to XPreformatted
has now been made? I personally prefer the "old" behaviour, so I'd like
to know if reverting the change locally is "safe".

> Probably we should be using the ascent here, but I'm not enough of a

> typographer to say definitely. What you seem to be saying is that we

> should allow for variable padding. We seem to draw the background

> around the paragraph as a whole. I'm sure that makes sense in visual

> terms.


The problem I'm experiencing (which is probably totally unrelated to the
"right" way of doing things) is that the text of the Paragraph has
visually moved from being v_aligned middle to being v_aligned top. This
leads to the text touching the top of the box, and leaving empty space
at the bottom, which can be relatively large where leading > font_height
(which it usually is, at least by a few points). The HTML/CSS
"padding-top" variable padding would certainly solve the problem, though
that seems overkill to fix something I initially thought was just a
temporary hack on someone's TODO list - that'll teach me never to read
comments again ;)

If it's not clear what I'm referring to, I can try to produce a "before
and after" to demonstrate.

Thanks again,
Paul Barrass.


More information about the reportlab-users mailing list