[reportlab-users] Wrapping text -- changing space between wrapped lines?
robin at reportlab.com
Thu Aug 30 08:58:09 EDT 2012
On 28/08/2012 15:35, Funke, Matt wrote:
> I've got some text going into a grid with tightly-defined space in each column. Of course, if it doesn't fit in the defined column width, it wraps around, and that's fine. The problem seems to arise when the text is too long. If I could reduce the amount of space in between each line during wraparound, it would still fit nicely. Could someone point me to information about how to do that within a reportlab.playtpus.tables.Table?
> Thanks for your time. Let me know if there's any way I can clarify what I'm after.
You are presumably using a paragraph to wrap the text. The property that sets
the interline spacing is called leading; by default I think we use 1.2*fontSize
for leading, but you can alter it in the style that's used. If you are using the
same style elsewhere then you should create a copy using
cellStyle = ParagraphStyle(name='cellStyle',parent=originalStyle,leading=7.5)
so that the leading change isn't applied where you don't want it.
Also table cells have padding which you can set to zero to increase the total
area of the cell that gets used.
More information about the reportlab-users