[reportlab-users] Wrapping text -- changing space between wrapped lines?
Matt.funke at vishaypg.com
Thu Sep 13 10:34:27 EDT 2012
Thanks for this! It worked like a charm.
Vishay Precision Group, Inc.
951 Wendell Blvd
Wendell, NC 27591 USA
From: reportlab-users-bounces at lists2.reportlab.com [mailto:reportlab-users-bounces at lists2.reportlab.com] On Behalf Of Robin Becker
Sent: Thursday, August 30, 2012 8:58 AM
Subject: Re: [reportlab-users] Wrapping text -- changing space between wrapped lines?
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.
reportlab-users mailing list
reportlab-users at lists2.reportlab.com
More information about the reportlab-users