valign middle and font size

Mathieu Ambrosy via reportlab-users <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <[email protected]>
Hi,

I don't understand why "valign middle" don't work correctly when I set 
"FONTSIZE 14" in my table style ?
It's like "valign" position is computed with default font size 
independently of my font size ?

How to solve this ?

Regards.

#========== START ================
from reportlab.lib import colors
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, 
Paragraph
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont

pdfmetrics.registerFont(TTFont('Calibri', 'c:/temp/calibri.ttf'))

elements = []

row1 = [
['ATTR1', 'VALUE1'],
['ATTR2', 'VALUE2'],
]

t1=Table(
row1,
style=[
('BOX',(0,0),(-1,-1),0.5,colors.black),
('GRID',(0,0),(-1,-1),0.5,colors.black),
('TEXTCOLOR',(0,0),(1,-1),colors.black),
('FONT',(0,0),(-1,-1),'Calibri'),
#========== HERE ================
#('FONTSIZE',(0,0),(-1,-1),14),
#========== HERE ================
('ALIGN',(0,0),(-1,-1),'CENTER'),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
],
colWidths=(11.2*cm, 7.8*cm),
rowHeights=(1*cm, 1.7*cm)
)

elements.append(t1)

doc = SimpleDocTemplate("c:/temp/test.pdf", pagesize=A4)
doc.build(elements)
#========== END ================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.