[Image-SIG] How to change size of PIL fonts?
Dévji Chhãngã
dev.chh at gmail.com
Tue Oct 12 13:31:30 CEST 2010
Hello Image-SIG,
I am a newbie to PIL, I have following code
def __setFont (self, filename):
pilfont = ImageFont.load(filename)
return pilfont
def drawImage (self):
cg = CaptchaString(4)
myString = cg.getString() #Some other object to get string from
myFont = self.__setFont('E:\\pilfonts\\timB12.pil')
img = Image.new('RGB', (220,90), '#FFFFFF')
drawText = ImageDraw.Draw(img)
drawText.text((6, 0), myCaptchaString, font=myFont, fill=(255, 100,
25))
img.save('myFile.png', 'PNG')
I don't know how to set font size so that it appear larger
Devji Chhanga
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20101012/2357ddb3/attachment.html>
More information about the Image-SIG
mailing list