Mercurial > ift6266
annotate scripts/fonts_test.py @ 141:3346fcd3818b
Changé un True pour False, mais je le commit car c'est ça que j'utilise pour lancer mes jobs.
author | fsavard |
---|---|
date | Mon, 22 Feb 2010 14:22:07 -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 |