Re: Hyphenation
Lele Gaifax <[email protected]>
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Organization | Nautilus Entertainments |
| Message-ID | <[email protected]> |
Lele Gaifax <[email protected]> writes: > However, I must be missing something in the "width" argument, because for > example when using a ImageAndFlowables it clearly uses the wrong width in the > "second" part (where the image ends so there's a wider space available)... I think I figured it out and spotted the problem with ImageAndFlowables: the widget basically first calls .wrap() on the paragraphs on image's side, that in turn compute their blPara attribute, then if the height of the flowables is taller than the image's it splits the paragraphs, and that's where it does the wrong thing (for my purpose, of course): the Paragraph.split() method cuts it in two halves, rebuilding their respective frags attribute from blPara honoring the height constraint, and thus possibly already hyphenated words end into the ParaFrag structure and are eventually rendered as-is into a possibly wider context. Fixing the issue is complicated, because the Paragraph.split() method calls plain functions (_split_blParaSimple() and _split_blParaHard()) so I should override the whole method simply to call a "smarter" implementation that knows about _SplitText and _SplitList... At this point, given that my need for ImageAndFlowables is marginal at best, I won't be feeding it PyphenParagraphs, using them only in "plain" containers. I updated my gist to what I'm currently using, previous version had a glitch with multifrag paragraphs. Thanks in advance for any further insight. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. [email protected] | -- Fortunato Depero, 1929. _______________________________________________ reportlab-users mailing list [email protected] https://pairlist2.pair.net/mailman/listinfo/reportlab-users