Ian Sparks
2003-04-10 13:52:13 UTC
I need to work out the height of a line of text to find out if it will =
fit the box I'm writing it to (using raw canvas commands not Platypus).
#self is a "font" class which has a fontname and a size e.g. =
"Helvetica",8
h =3D pdfmetrics.TypeFace(self.fontname)
self.textHeight =3D ((h.ascent - h.descent) * self.size) / 1000
I'm not sure that the ascent and descent figures I'm getting back are =
correct however, they are 718 and -207 respectively.
Am I even going about this the correct way?
- Ian Sparks.
fit the box I'm writing it to (using raw canvas commands not Platypus).
#self is a "font" class which has a fontname and a size e.g. =
"Helvetica",8
h =3D pdfmetrics.TypeFace(self.fontname)
self.textHeight =3D ((h.ascent - h.descent) * self.size) / 1000
I'm not sure that the ascent and descent figures I'm getting back are =
correct however, they are 718 and -207 respectively.
Am I even going about this the correct way?
- Ian Sparks.