Skip to content

Instantly share code, notes, and snippets.

@jo-lang
Created November 19, 2020 12:46
Show Gist options
  • Save jo-lang/cafbb3f8df87f28e7889d7b008db819a to your computer and use it in GitHub Desktop.
Save jo-lang/cafbb3f8df87f28e7889d7b008db819a to your computer and use it in GitHub Desktop.
Interpretation of a work by Timm Ulrichs to be run in drawbot app
'''
An interpretation of a work by Timm Ulrichs
see this blog post: https://letterformarchive.org/news/shaped-text
See other solutions in this twitter-thread:
https://twitter.com/MauriceMeilleur/status/1329218247594561538
'''
# ---------------
# S E T T I N G S
PW = PH = 400
amount = 25
char = 'e'
frames = 10
fnt = 'Helvetica-Bold'
# ---------------
cell_s = PW / (amount + 4)
f_str = FormattedString()
f_str.append(char, font = fnt, fontSize = cell_s * 1.55)
char_w, char_h = f_str.size()
pth = BezierPath()
pth.text(f_str, (-char_w/2, -char_w/2))
for fr in range(frames):
p_rot = fr/frames * 360
newPage(PW, PH)
translate(cell_s * 2, cell_s * 2 - char_h/4)
for i in range(amount):
for j in range(amount):
angle = 0
for r in range(amount):
if (r <= i <= amount - r - 1 and r <= j <= amount - r -1):
angle = r
with savedState():
translate(i * cell_s + char_w/2, j * cell_s + char_h/2)
rotate(angle / (amount//2) * 360 + p_rot)
drawPath(pth)
# saveImage('Timm_Ulrichs_rotating_e.gif')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment