Skip to content

Instantly share code, notes, and snippets.

@connordavenport
Last active January 26, 2024 06:29
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connordavenport/12cc057798b175782431a883e63386db to your computer and use it in GitHub Desktop.
Save connordavenport/12cc057798b175782431a883e63386db to your computer and use it in GitHub Desktop.
bitmapFont-Drawbot
w = h = 1000
newPage(w,h)
fill(0)
rect(0,0,w,h)
# -------- change these -------- #
pixelSize = 7
copy = "Testing"
fontSize = 280
fontName = 'path/to/font.otf'
# ------------------------------ #
b = BezierPath()
b.text(copy, font=fontName, fontSize=fontSize, offset=(500,500), align="center")
for x in range(0, h, pixelSize):
for y in range(0, h, pixelSize):
if b.pointInside((x,y)):
fill(1,.7,.33,1)
else:
fill(.2,.2,.2,1)
oval(x-(pixelSize/2),y-(pixelSize/2),pixelSize,pixelSize)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment