Add a new logo for the autotest web interface
[autotest-zwu.git] / tko / vertical_text.py
blobcc3c4f6ff4c1c7e5685ede72d83eb2d9efd5c75a
1 #!/usr/bin/env python
3 import gd, os, cStringIO, urllib2, sys
5 fontlist = [
6 '/usr/lib/python/site-packages/reportlab/fonts/PenguinAttack.ttf'
7 '/usr/share/fonts/truetype/freefont/FreeSans.ttf',
8 '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
11 fontpath = '.'
12 for f in fontlist:
13 if os.path.exists(f):
14 fontpath = fontpath + ':' + os.path.dirname(f)
15 FONT = os.path.basename(f)
16 break
18 os.environ["GDFONTPATH"] = fontpath
20 try:
21 FONT
22 except NameError:
23 print "no fonts found"
24 sys.exit(1)
26 def simple():
27 im = gd.image((20,200))
29 white = im.colorAllocate((255, 255, 255))
30 black = im.colorAllocate((0, 0, 0))
32 #im.colorTransparent(white)
33 im.interlace(1)
35 im.string_ttf(FONT, 10.0, 1.56, (15, 190), sys.argv[1], black)
37 f=open(sys.argv[1]+".png","w")
38 im.writePng(f)
39 f.close()
41 simple()