[reportlab-users] RE: Experience with new-style paragraphs?

Aaron Watters reportlab-users@reportlab.com
Mon, 14 Oct 2002 10:15:27 -0400


Andy Robinson wrote:

>>A paragraph should be considered as something like a 
>>"left-to-right, then
>>top-down" container.
>>
>
>That is the right general model.  It's also why I put some
>'symmetry' into the wrap/draw API, so it could be used for 'inline'
>flowables as well.  However, doing word level stuff
>in pure Python is a performance killer - we tried once.  It would be 
>very interesting to prototype such a model, and then see how
>suitable it was to optimization.  
>
That's exactly what the new style paragraph does.  You can very easily 
put an image
or a table inside it.  I just didn't get around to it.  Unless I'm 
missing something.  The
only complication I can think of is that I don't think you can really 
tell the table "how much
space is left" because "how much space" has to be determined after the 
elements of
the paragraph have been split and justified.  What makes the 
implementation look complicated
is the problem of efficiently handling things like underlining and hotlinks.

Another problem is that if the table/image is too long for the leading 
it will overlap the previous
or next line.  I think dynamically adjusting the leading is overdesign 
and will look awful
anyway.

Look at PageNumberObject, for example.  You can add images in a similar 
manner.

   -- Aaron Watters

===
Better watch out when you don't know where you are going because
you might not get there.  -- Yogi Berra