comparison scripts/fonts_test.py @ 135:36010ff90255

Added script to test truetype font files validity (corruption)
author boulanni <nicolas_boulanger@hotmail.com>
date Sat, 20 Feb 2010 02:10:30 -0500
parents
children bb26c12bb9f6
comparison
equal deleted inserted replaced
134:4981c729149c 135:36010ff90255
1
2 import random, os
3 import ImageFont, ImageDraw, Image
4
5 dir1 = "/data/lisa/data/ift6266h10/allfonts/"
6
7 img = Image.new("L", (100,100))
8 draw = ImageDraw.Draw(img)
9
10 for f in os.listdir(dir1):
11 try:
12 font = ImageFont.truetype(dir1+f, 25)
13 textSize = font.getsize("kD9")
14 except:
15 print dir1+f