properly close files
[PyX.git] / gallery / misc / pyxpyx.py
blob1091c0a2f0df0bdf5068291c3ad89f6119dd9093
1 from pyx import *
3 textpath = text.text(0, 0, r"\PyX").textpath().reversed()
4 decotext = r"\PyX{} is fun! "*50
5 scale = text.text(0, 0, decotext).width/textpath.arclen()
7 c = canvas.canvas()
8 c.draw(textpath, [trafo.scale(scale),
9 deco.filled([color.gray(0.5)]),
10 deco.curvedtext(decotext)])
11 c.writeEPSfile("pyxpyx")
12 c.writePDFfile("pyxpyx")