Erik van Blokland 3646055ea2 initial import
git-svn-id: http://svn.robofab.com/trunk@1 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-01-07 17:40:34 +00:00

26 lines
563 B
Python

from cgDocument.cgDocument import newDocument
from cgDocument.cgPen import CoreGraphicsPen
from robofab.world import CurrentGlyph, CurrentFont
from robofab.interface.all.dialogs import PutFile
import cgDocument.cgPen
reload(cgDocument.cgPen)
f = CurrentFont()
g = CurrentGlyph()
doc = newDocument((1000, 1000), "pdf")
pen = CoreGraphicsPen(f)
doc.setFillCMYK((1,1,0,1,1))
doc.scale((1, -1))
doc.rect((10, 10, 100, 100))
g.draw(pen)
pen.addToDocument(doc)
dst = PutFile("Save the pdf:")
if dst is not None:
print dst
doc.save(dst)