[reportlab-users] Paragraph "Hack"

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

Robin Becker wrote:

> ......

> I know exactly what the change did. In the old way of doing things we

> assumed (without justification) that the baseline was fontSize below

> the top of the text.



> Now we attempt to improve matters by using the actual ascent and

> descent to specify the ascender and descender lines. In addition

> there's the leading which is supposed to be larger than ascender -

> descender. I assume that you're seeing a visual difference because

> your fontSize is larger than the ascent. There was never any

> intention to visually vertically centre anything, western fonts are by

> nature not vertically symmetric. If you adjust this locally all that

> will happen is that XPreformatteds will also be adjusted by your

> reversion. However, your change to the initial y will not change the

> internal way that the lines are spaced ie most of the code will

> continue to use ascent and descent.


Thanks for the explanation. It appears that the new method is working
perfectly in that it's achieving what is it that you set out to do.
Unfortunately for me, this means you're unlikely to "fix" it.. ;)

> My impression is that if we could allow you to adjust the top/bottom

> padding you could achieve the visual style that is required. Currently

> borderPadding is a singleton. That would not alter the exact

> positioning of the paragraph topline though.

If I could specify a padding of 2-3pt at the top without that forcing
extra padding on the other sides that would solve my problem perfectly.
I'm not in any great rush for a fix though, the production servers will
be on 2.1 for the foreseeable future.

Thanks again,
Paul Barrass.

More information about the reportlab-users mailing list