[reportlab-users] Text scaling and finding out how much space text will take up

Andy Robinson andy at reportlab.com
Wed Nov 1 16:56:40 EST 2006


Chris Withers wrote:
> Andy Robinson wrote:
>> Correctly, as long as you have registered the font ;-)
>>
>> The code to register TT fonts is in the user guide, Ch3 I think.
> 
> Great, yep, I remember it :-)
> 
> Which leaves one question: how do I horizontally scale (ie: squish) text 
> by a certain amount?


canv.saveState()
canvas.scale(0.5, 1.0)
canv.drawString(x, y, 'half as slim but just as tall')
canv.restoreState()

- Andy


More information about the reportlab-users mailing list