I just updated the repo with separated snippets for SublimeText.

Hugo Jourdan
@Hugo Jourdan
Best posts made by Hugo Jourdan
-
RE: DrawBot Auto-completion Snippet
-
Rounded Rectangle
Snippet do draw rectangle with rounded corner:
def rectRounded(x,y,w,h,radius): path = BezierPath() sR=0.5*radius w=w-radius h=h-radius path.rect(x,y+sR,w+radius,h) path.rect(x+sR,y,w,h+radius) path.oval(x,y,radius,radius) path.oval(x+w,y,radius,radius) path.oval(x,y+h,radius,radius) path.oval(x+w,y+h,radius,radius) path.removeOverlap() drawPath(path)
It is possible to manually add it in drawBot module ?
Latest posts made by Hugo Jourdan
-
Snippet : drawOnCurvePoints
This snippet allow to draw points of a BezierPath ignoring quadratic added nodes when exporting a font.
def drawOnCurvePoints(bezierPath, size): for c in bezierPath: for p in c.points: i = c.points.index(p) try: nextPoint = c.points[i+1] except: nextPoint = c.points[0] previousPoint = c.points[i-1] if nextPoint in bezierPath.onCurvePoints and previousPoint in bezierPath.onCurvePoints : oval(p[0]-size/2,p[1]-size/2, size ,size) if nextPoint[0] == p[0] and p in bezierPath.onCurvePoints: oval(p[0]-size/2,p[1]-size/2, size ,size) if previousPoint[0] == p[0] and p in bezierPath.onCurvePoints: oval(p[0]-size/2,p[1]-size/2, size ,size) if nextPoint[1] == p[1] and p in bezierPath.onCurvePoints: oval(p[0]-size/2,p[1]-size/2, size ,size) if previousPoint[1] == p[1] and p in bezierPath.onCurvePoints: oval(p[0]-size/2,p[1]-size/2, size ,size)
-
listNamedInstances is broken ?
Hi,
I tried to use
listNamedInstances(fontPath)
It seem to list the first instance (depending if variable font contain italic).
I test it with several Google Font and some of mine mine and the problem persists.
I check with FontTableViewer and all instances are present in [name] and [fvar] table.
-
RE: Mute DrawBot warning ?
I'm looking to not print :
*** DrawBot warning: [...] ***
-
Mute DrawBot warning ?
Hi,
There is a way to not show DrawBot warning ?
-
RE: BezierPath offset problem.
@frederik Thanks for this clarification !
-
BezierPath offset problem.
Hi,
I would like to translate a BezierPath, without changing it's bounds.Here is code where you can see my problem.
newPage(2000,2000) # Grey Rectangle path0 = BezierPath() path0.rect(1000,10,200,1990) with savedState(): fill(0, 0.1) drawPath(path0) # Green Rectangle path1 = BezierPath() path1.text("1", fontSize=200) with savedState(): fill(0,1,0) rect(*path1.bounds()) drawPath(path1) # Red Rectangle path2 = BezierPath() path2.text("2", fontSize=200, offset=(200,300)) with savedState(): fill(1,0,0) rect(*path2.bounds()) drawPath(path2) # Yellow Rectangle path3 = BezierPath() path3.text("3", fontSize=200) path3.translate(100,800) with savedState(): fill(1,1,0) rect(*path3.bounds()) drawPath(path3) # Magenta Rectangle translate(900,800) path4 = BezierPath() path4.text("4", fontSize=200) with savedState(): fill(1,0,1) rect(*path4.bounds()) drawPath(path4)
I tested 3 solution:
-
use offset in path.text
Change BezierPath bounds
-
use path.translate
Change BezierPath bounds
-
use translate
Don't change BezierPath bounds
But this is annoying, because I don't want to translate all my canvas just for that.
So what is the solution ?
-
-
RE: DrawBot Auto-completion Snippet
I just updated the repo with separated snippets for SublimeText.
-
DrawBot Auto-completion Snippet
Hi,
I recently uploaded snippets to add DrawBot auto-completion in VSCode, Atom and SublimeText.
You can access them from my GitHub Repo:
https://github.com/HugoJourdan/Drawbot-TextEditor-Snippets -
Python Update ?
It is possible to manually update Python version in drawBot ?
I'm facing a situation where I can't use a module inside drawBot because it uses Python 3.10