I'm writing a script that takes my grades from my school grade website and draws the grades onto an image and saves it as my background and I'm trying to change the font when i draw the text onto the image but I'm getting an error
Here is the code I'm trying:
font = ImageFont.load('C:\WINDOWS\Fonts\CALIBRI.TTF')
img = Image.open('bg.bmp')
draw = ImageDraw.Draw(img)
now = datetime.datetime.now()
draw.text((625, 425),' CURRENT GRADES' )
draw.text((625, 475), 'Period 1: Geography -----------------------------{0}'.format(a),("blue"),(font))
draw.text((625, 525), 'Period 2: Francais-------------------------------{0}'.format(b),("red"),(font))
draw.text((625, 575), 'Period 3: Science--------------------------------{0}'.format(c),("orange"),(font))
draw.text((625, 625), 'Period 4: P.E------------------------------------{0}'.format(d),("blue"),(font))
draw.text((625, 675), 'Period 5: Algebra 9------------------------------{0}'.format(e),("red"),(font))
draw.text((625, 725), 'Period 6: LA-------------------------------------{0}'.format(f),("orange"),(font))
draw.text((625, 775), 'Last Updated: {0}'.format(now))
img.save('mod_bg.bmp')
but when i do this i get this error message:
Traceback (most recent call last):
File "C:\Python27\Project.py", line 45, in <module>
font = ImageFont.load('C:\WINDOWS\Fonts\CALIBRI.TTF')
File "C:\Python27\lib\site-packages\PIL\ImageFont.py", line 193, in load
f._load_pilfont(filename)
File "C:\Python27\lib\site-packages\PIL\ImageFont.py", line 91, in _load_pilfont
raise IOError("cannot find glyph data file")
IOError: cannot find glyph data file
can anyone tell me why this isn't working and what i should do instead