view scripts/fonts_test.py @ 148:72a2d431d047

Rajout d'un seed random et d'une fonction get_seed
author SylvainPL <sylvain.pannetier.lebeuf@umontreal.ca>
date Wed, 24 Feb 2010 13:14:02 -0500
parents bb26c12bb9f6
children
line wrap: on
line source

#!/usr/bin/python                                                                                 

import os
import ImageFont, ImageDraw, Image

dir1 =  "/data/lisa/data/ift6266h10/allfonts/"
#dir1 = "/Tmp/allfonts/"

img = Image.new("L", (132,132))
draw = ImageDraw.Draw(img)
L = [chr(ord('0')+x) for x in range(10)] + [chr(ord('A')+x) for x in range(26)] + [chr(ord('a')+x) for x in range(26)]

for f in os.listdir(dir1):
    try:
        font = ImageFont.truetype(dir1+f, 25)
        for l in L:
            draw.text((60,60), l, font=font, fill="white")
    except:
        print dir1+f