You're right to use the BezierPath()
. Instead of using a normal textBox
use the BezierPath's textBox like so:
textPath = BezierPath()
overflow = textPath.textBox(txt, (x, y, w, h))
fill(0.5)
drawPath(textPath)
You're right to use the BezierPath()
. Instead of using a normal textBox
use the BezierPath's textBox like so:
textPath = BezierPath()
overflow = textPath.textBox(txt, (x, y, w, h))
fill(0.5)
drawPath(textPath)
While I'm working on an animation I run the script once to save the .gif file to the disk, then I select the file and hit the space bar to open it in Quick Look to preview the animation. I leave this preview window open in the Finder while I continue to work on editing the script in DrawBot — every time the file gets updated with a newly saved .gif it will automatically start previewing the new version. Kind of a strange technique but it works!
Until there's a new feature for this, I think you could replace your newPage()
calls to a custom newPageWithBleed()
that goes something like this, and wouldn't need to change any of your other drawing code —
def newPageWithBleed(w, h, bleed):
newPage(w + bleed * 2, h + bleed * 2)
translate(bleed, bleed)
W, H = 400, 400
bleed = 25
newPage(W, H)
rect(0, 0, 20, 20)
newPageWithBleed(W, H, bleed)
rect(0, 0, 20, 20)
Until there's a new feature for this, I think you could replace your newPage()
calls to a custom newPageWithBleed()
that goes something like this, and wouldn't need to change any of your other drawing code —
def newPageWithBleed(w, h, bleed):
newPage(w + bleed * 2, h + bleed * 2)
translate(bleed, bleed)
W, H = 400, 400
bleed = 25
newPage(W, H)
rect(0, 0, 20, 20)
newPageWithBleed(W, H, bleed)
rect(0, 0, 20, 20)
You're right to use the BezierPath()
. Instead of using a normal textBox
use the BezierPath's textBox like so:
textPath = BezierPath()
overflow = textPath.textBox(txt, (x, y, w, h))
fill(0.5)
drawPath(textPath)
While I'm working on an animation I run the script once to save the .gif file to the disk, then I select the file and hit the space bar to open it in Quick Look to preview the animation. I leave this preview window open in the Finder while I continue to work on editing the script in DrawBot — every time the file gets updated with a newly saved .gif it will automatically start previewing the new version. Kind of a strange technique but it works!