annotate scripts/fonts_test.py @ 136:4a78c9b83fee

Added script to launch the ~108 data generation jobs with dbidispatch
author boulanni <nicolas_boulanger@hotmail.com>
date Sat, 20 Feb 2010 02:11:56 -0500
parents 36010ff90255
children bb26c12bb9f6
rev   line source
135
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
1
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
2 import random, os
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
3 import ImageFont, ImageDraw, Image
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
4
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
5 dir1 = "/data/lisa/data/ift6266h10/allfonts/"
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
6
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
7 img = Image.new("L", (100,100))
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
8 draw = ImageDraw.Draw(img)
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
9
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
10 for f in os.listdir(dir1):
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
11 try:
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
12 font = ImageFont.truetype(dir1+f, 25)
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
13 textSize = font.getsize("kD9")
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
14 except:
36010ff90255 Added script to test truetype font files validity (corruption)
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff changeset
15 print dir1+f