[reportlab-users] Ascent, descent and tables

Andy Robinson andy at reportlab.com
Fri May 22 18:30:16 EDT 2009

2009/5/21 Andy Robinson <andy at reportlab.com>:

> We will try to change things so that (a) paragraphs report their

> bounding box as precisely as possible, and tables can then center this

> box vertically; and (b) paragraphs try to position naked text the same

> way they would position a one-line paragraph with the same font size

> and "leading".

I just committed a simple change and believe that the overall vertical
shift is now back where it was. (i.e. I ran the new tables script
against 2.1 and trunk, and can't find any differences). (b) works,
but it turns out (a) was always wrong and still is.

However, this may not be the end of it. I will need to talk to the
folks at Wikipedia next week, who asked for these changes within
paragraph code, and check if any of this matters to them. I am
working on the theory that what they needed was internal to multiline
paragraphs, and that an overall vertical shift was not part of the
spec, so shifting it back won't bite them. I therefore left a big
switch in the code so we developers can flip back and forth on this.

The new test page backported to 2.1 shows that neither the old nor the
new code accurately worked out the 'boundary of the paragraph', but
that our old dumb algorithm looks as good to the eye as anything else.

Marius, thanks very much for your help!


More information about the reportlab-users mailing list