[reportlab-users] Hyphenation

Robin Becker robin at reportlab.com
Mon Jun 25 04:02:49 EDT 2018

On 25/06/2018 08:50, Lele Gaifax wrote:
> Robin Becker <robin at reportlab.com> writes:
>> probably I will drop the support for an explicit attribute. If that's done
>> then the easy way for you to subclass Paragraph would be something like
>> from reportlab.platypus import Paragraph
>> class LeleParagraph(Paragraph):
>>      def __init__(self, text, style, **kwds):
>>          hyphenator = kwds.pop('hyphenator',kwds.pop('hyphenationLang',None))
>>          if hyphenator:
>>              #override the default
>>              style = style.clone(style.name+'-hyphenated', hyphenationLang=hyphenator)
>>          Paragraph.__init__(self,text,style, **kwds)
> Ok, no problem at all: I actually tried both approaches (that is, having a
> custom Paragraph and tweaking the style), and I could not decide which is
> better, so your decision definitely helps ;-)
> Can you tell if this is going to land in the upcoming (July?) official
> release?

I sure hope so.

> Thanks for your support,
> ciao, lele.

Robin Becker

More information about the reportlab-users mailing list