Re: Parsing of <table> & ICU wordWrap
Buganini <[email protected]>
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Message-ID | <CAC_-zwdQ2HknQUb6LURzOOLVGP0wd+BSXvM4tTUgPPg5UhrzBg@mail.gmail.com> |
> Hi,
>
> I'm not exactly sure what the use case is here. Form a quick inspection of
> the change sets it looks like you are using the cbDefn stuff to add a
> flowable (table) in the middle of a paragraph like an <img>; is that
> correct?
That's correct, BTW I don't know the meaning of cbDefn.
> I can imagine that people might want to put a table of figures into flowing
> text as a float, but the in line usage kind of escapes me.
Since I wrap it with available width, it renders as a block element
(in terms of CSS):
def wrap(self, availWidth, availHeight):
# work out widths array for breaking
self.width = availWidth
style = self.style
leftIndent = style.leftIndent
first_line_width = availWidth -
(leftIndent+style.firstLineIndent) - style.rightIndent
later_widths = availWidth - leftIndent - style.rightIndent
self._wrapWidths = [first_line_width, later_widths]
+ for f in self.frags:
+ cb = getattr(f, 'cbDefn', None)
+ if cb and cb.kind=='flowable':
+ cb.width, cb.height = cb.flowable.wrap(availWidth, None)
+ f.width = cb.width
> --
> Robin Becker
> _______________________________________________
> reportlab-users mailing list
> [email protected]
> https://pairlist2.pair.net/mailman/listinfo/reportlab-users