[reportlab-users] How are split, wrap, wrapOn supposed to work?

Robin Becker robin at reportlab.com
Tue Nov 18 08:02:20 EST 2014


Henning,

I fixed up to use the latest code and also tried to get the test working with 
wordaxe. My logging wrapper fails to produce any output presumably because we 
pass a negative width into the wrap call and then the i_wrap function fails 
fairly badly ie loops forever.

I think the platypus Pargaraph wrap succeeds because the standard breaklines 
(which computes the line breaks) always adds at least one 'word' before failing. 
That at least makes the layout proceed even if nonsensically. The result is that 
effectively when negative availWidth is passwed to the wrap method we split the 
line into individual words and ignore the width constraint. The returned width 
is then the maximum word width and the height is leading*len(words).

I looked at your code, but was not able to figure out why the assertion error 
doesn't get raised at line 594.
-- 
Robin Becker


More information about the reportlab-users mailing list