thanks for the issue
-
RE: listNamedInstances is broken ?
can you provide the not working google fonts?
and if this is persisting, it would be handy to open an issue in the drawBot repo.
thanks!
-
RE: Running Drawbot as a module in environments that aren't Mac OS X
DrawBot is mac only... that will not change fast as we got now a super high level of typographic support...
However Just started drawBotSkia which has a subset of the DrawBot api but uses skia as backend.
-
RE: Mute DrawBot warning ?
you can always ignore all warnings with:
import warnings warnings.simplefilter("ignore")
-
RE: BezierPath offset problem.
the mistake here is that bounds are not structured as
x
,y
,width
,height
as required forrect(...)
but asminx
,miny
,maxx
,maxy
.minx, miny, maxx, maxy = path.bounds() rect(minx, miny, maxx-minx, maxy-miny)
-
RE: Python Update ?
no, you can not.. but DrawBot exists also as a module where you can use your own python.
see https://github.com/typemytype/drawbot#using-drawbot-as-a-python-module
-
RE: Beginner Question
its all the same and very much based on coding flavours
different approach, similar result, here you know the amount of lines exactly.
import random size(600, 849) margin = 106 density = [3,2,7,20, 1002] # the amount of lines rows = len(density) row_width = width() - 2 * margin row_height = (height() - 2 * margin) / rows fill(None) strokeWidth(1) stroke(0) for i, d in enumerate(density): y1 = margin + i * row_height y2 = y1 + row_height x_positions = [random.random() * row_width for _ in range(d)] for x in x_positions: line((x, y1),(x, y2))
-
RE: Beginner Question
thanks @monomonnik! very well explained!
the while loop at the end makes its maybe a bit unreadable...
you can use
random.sample
to generate a random list easily:import random density = 5 result = random.sample(range(0, 100), density) print(result)
-
RE: Rewind rect() x position for endless movement
I guess you made it to difficult...
Variable([ dict(name="progress", ui="Slider", args=dict( value=0, minValue=0, maxValue=1, )), ], globals()) backgroundColors = [ (0.5, 1, 0.5), (0.5, 1, 1), (0.5, 0, 0), (1, 1, 0), (0.5, 0, 1), (0.5, 0.5, 0.5), (0, 1, 0) ] # pageW, pageH = (500, 500) pageW, pageH = width(), height() advance = pageW * progress itemCount = len(backgroundColors) itemWidth = pageW / (itemCount) moveIndex = int(advance * progress // itemWidth) backgroundColors = backgroundColors[-moveIndex:] + backgroundColors for i in range(0, itemCount + 1): color = backgroundColors[i] fill(*color) rect(itemWidth * (i-moveIndex) - itemWidth + advance * progress, 0, itemWidth, pageH) fill(None) stroke(0) strokeWidth(10) rect(0, 0, pageW, pageH)