[reportlab-users] valign with large fonts
robin at reportlab.com
Wed Jun 4 05:28:27 EDT 2008
Arkadi Colson wrote:
> So the only option will be detecting the font hight some way and using
> bottom padding to enlarge the cell?
the code that does the alignment for simple cells looks like this
just = cellstyle.alignment
valign = cellstyle.valign
vals = string.split(str(cellval), "\n")
n = len(vals)
leading = cellstyle.leading
fontsize = cellstyle.fontsize
y = rowpos + cellstyle.bottomPadding+n*leading-fontsize
y = rowpos + rowheight - cellstyle.topPadding - fontsize
#tim roberts pointed out missing fontsize correction 2004-10-04
y = rowpos + (cellstyle.bottomPadding +
rowheight-cellstyle.topPadding+n*leading)/2.0 - fontsize
so the valign style attribute should be doing something different. Can you send
an example piece of text together with the style that's supposed to be being
used eg font, font size leading etc etc. Then I'll try and have a look to see
what's going on.
........nt size is variable.
>>> Thanks in advance,
>> I have a feeling that valign should be middle, but the vertical
>> alignment has always caused trouble so it might be busted.
More information about the reportlab-users