[reportlab-users] Bug in Paragraph class with tags when switching frames

Robin Becker robin at reportlab.com
Fri Nov 2 08:42:15 EDT 2007


Henning von Bargen wrote:

> Hi Robin,

>

> if you are going to identify and fix the bug,

> can you do me a favour and send me a note

> about what changes exactly are necessary in

> paragraph.py to fix it?

>

> It would help me a lot


I will do my best. For other reasons we have been going through the paragraph
code to add inline images (and autoLeading) and those are now present. I'm
pretty busy right now so may not get to this for a couple of days.

.

>

> For the hyphenation library wordaxe-0.2.4

> (to be released soon), I switched to a more

> object-oriented approach, inheriting most of

> the member functions in

> class wordaxe.rl.paragraph.Paragraph directly from

> class reportlab.platypus.paragraph.Paragraph.

>

> The main difference is the breakLines method,

> which is almost unreadable in the RL Paragraph

> class and even more in my adopted version.

>

> I tried to find out what's happening in the RL 2.1

> version yesterday for at least 2 hours, without

> success.

>


this code needs to be taken out and shot (and me with it since I'm the cause of
the problem).


> One thing I found out at least is that the frag

> list contains a frag with .text='' between

> the frags with .text='nur' and .text='ein',

> whereas all the other frags representing spaces

> contain .text=' '.

> And it seems this has to do with code where

> g.text = nText somewhere.

>

> But honestly, I don't fully understand the code,

> perhaps because some of the variables are

> undocumented and don't have meaningful names.

>


The real problem here is that python is not fast enough to do a proper split
into words model with all the words represented as glyphs. That makes us do all
the special cases. This special case is very nice so I hope we haven't
accidentally fixed it.


> For switching from my old version and RL 2.0

> to the new version and RL 2.1, I had a hard time

> viewing diff output - there are just too many

> differences; and I don't want to do that again.

>

> If you can point me to a few lines that must be

> changed in the RL 2.1 version in order to fix the

> bug, I could adopt the change to my version -

> which has a VERY similar bug - quite easily.

..... will do
--
Robin Becker


More information about the reportlab-users mailing list