@mauricemeilleur You're seeing the representation of your shape as cubic beziers. The quads get converted to cubic because the underlying NSBezierPath doesn't support quadratic curves.
Just van Rossum
Posts made by justvanrossum
@mauricemeilleur It's part of the "pen protocol" which lives in with FontTools, so any documentation should go there. It's documented in the code, have a look at the
The main trick for the blobs is indeed the fact that the contour will have no on-curve points, and that is achieved by passing
Noneas the last argument to
RE: How to run Drawbot on a server: Does it is possible?
@agyei Sounds like that should work.
RE: listFontGlyphNames() returning Alphabetical order?
@guidoferreyra It looks like DrawBot could be changed to do that, yes. Please file an issue on github. In the meantime, you could do it yourself via fontTools:
from fontTools.ttLib import TTFont font("AGaramondPro-Regular") f = TTFont(fontFilePath()) print(f.getGlyphOrder())
RE: Making new libraries
from . import mymodulenotation is only for relative imports within packages.
The easiest way is indeed to put your module in the same folder as the main script. But just write
from mymodule import nameinmymodule.
Note that imports ae cached: if you change your module, the main script won't see those changes until you reload your module (or restart DrawBot).
A grid of animated spirals
def spiral(cx, cy, diameter, angle): with savedState(): translate(cx, cy) scale(diameter / 1000) for i in range(100): rect(406, 0, 95, 95) rotate(angle) scale(0.99) gridSize = 100 margin = 50 canvasSize = 500 numFrames = 40 for frame in range(numFrames): t = frame / numFrames newPage(canvasSize, canvasSize) frameDuration(1/20) fill(0) rect(0, 0, canvasSize, canvasSize) fill(1) translate(margin, margin) for i in range(5): for j in range(5): a = 2 * pi * (t + (i + j) / 8) angle = 31 + 2 * sin(a) spiral(i*gridSize, j*gridSize, 95, angle) saveImage("~/Desktop/SpiralGrid.gif")