[reportlab-users] Understanding Wordwrap, esp. in tables

Robin Becker robin at reportlab.com
Wed Nov 14 09:09:46 EST 2007


Andrew Smart wrote:

> Hi,

>

> I'm trying to understand word wrapping in Platypus, especially the behaviour

> inside tables.

>

> I've a quite simple table which alings the text "left". The word wrapping

> seems to try to fill out the whole line, which is commonly adressed as

> "block" formatting where spaces are inserted between the words to fill up

> the whole line.





>

> I would like to use a "left" oriented word wrapping. The style parameter

> "wordWrap" doesn't know anything other than 'CFK' if I look at the source:

>

> if self.style.wordWrap == 'CJK':

> #use Asian text wrap algorithm to break characters

> self.blPara = self.breakLinesCJK([first_line_width,

> later_widths])

> else:

> self.blPara = self.breakLines([first_line_width, later_widths])

>

> Do I have to implement a left-oriented word wrapping routine by myself or is

> any other option avaiable?

........
what is left oriented wordwrapping are we talking bidi etc etc.

Table cells know nothing about wrapping; they know about text lines and
flowables (but not simultaneously. Paragraphs just about know how to break lines
at spaces or at <br/> tags. We don't split inside words and I don't think we do
right to left although others have done both.
--
Robin Becker


More information about the reportlab-users mailing list