[reportlab-users] nbsp and justification problem

Anton Petrushenkov wiseman.std at gmail.com
Wed May 5 03:11:11 EDT 2010


Some minor improvements to code (encountered unicode issues on some machines
for previous version):

So, in paragraphs.py, procedure _justifyDrawParaLineX, after line "nSpaces =
line.wordCount - 1"
add this:

# Taking NBSP into account
for word in line.words:
nNBSPs = unicode(word.text, 'utf-8').count(u'\xa0')
if nNBSPs:
nSpaces += nNBSPs

And that's it. Justification works fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100505/d1100c8b/attachment.html>


More information about the reportlab-users mailing list