[reportlab-users] Hyphenation

Lele Gaifax lele at metapensiero.it
Mon Jun 25 03:50:24 EDT 2018

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

Thanks for your support,
ciao, lele.
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at metapensiero.it  |                 -- Fortunato Depero, 1929.

More information about the reportlab-users mailing list