[reportlab-users] Word wrapping within table cells

Greg Rogers grogers at storediq.com
Fri Mar 16 18:15:45 EDT 2007


I should have mentioned that periodically the test will raise a
traceback. This happens when randomText creates something that is
considered multiple fragments.


_____

From: reportlab-users-bounces at reportlab.com
[mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Greg Rogers
Sent: Friday, March 16, 2007 5:11 PM
To: reportlab-users at reportlab.com
Subject: [reportlab-users] Word wrapping within table cells



I asked about word wrapping the other day. Henning von Bargen told me
about deco-cow. It looks pretty good, but I needed something very
simple and with a bit of control.


Here's a patch that adds a little bit of optional intelligence to the
CKJ word wrapping algorithm.

The addition is the notion of a preferred list of characters on which to
break the word. This allows breaking on punctuation characters like
comma, dash, period, etc. As you might guess, this is useful for
special text that is expected to have imbedded characters which are
natural break points. For example a table cell with file system paths
would be best split just after a slash.

A default set of perferred characters is provided, but you can easily
provide your own.

There's a test case that demonstrates the use.

Greg
<<reportlab.patch>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20070316/eda68686/attachment-0001.htm>


More information about the reportlab-users mailing list