[reportlab-users] cjk splitting problem

Volker Haas volker.haas at brainbot.com
Tue Jul 28 05:33:22 EDT 2009

Robin Becker wrote:

> .......

> thanks for the example. Andy the expert on CJK is away right now, but

> I think I did the expansion to multi-fragment so it's probably my bug.

> I'll try and take a look sooner rather than later.

Thanks for looking into the issue. While your at it: I spotted another
potential bug, but I didn't construct a minimal example so far. But
maybe the bug is obvious without an example:

In the "breakLinesCJK" method in paragraph.py the paragraph height
(self.height) is set too late in certain circumstances. I moved
self.height = 0 above the two return statements - this fixes the
problem. See the diff below. If a minimal example is required I'll try
to supply one.


Index: src/reportlab/platypus/paragraph.py
--- src/reportlab/platypus/paragraph.py (revision 3516)
+++ src/reportlab/platypus/paragraph.py (working copy)
@@ -1222,6 +1222,7 @@
if not isinstance(width,(list,tuple)): maxWidths = [width]
else: maxWidths = width
style = self.style
+ self.height = 0

#for bullets, work out width and ensure we wrap the right
amount onto line one
_handleBulletWidth(self.bulletText, style, maxWidths)
@@ -1241,8 +1242,6 @@
lines = []
lineno = 0

- self.height = 0
f = self.frags[0]

if hasattr(f,'text'):

volker haas brainbot technologies ag
fon +49 6131 2116394 boppstraße 64
fax +49 6131 2116392 55118 mainz
volker.haas at brainbot.com http://www.brainbot.com/

More information about the reportlab-users mailing list