Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MEHRINGDAMM: Spacing by bounding box
# Image from https://twitter.com/Berlin_Type/status/1250742042004766730
imagePath = "MEHRINGDAMM.jpeg"
w, h = imageSize(imagePath)
size(w, h)
with savedState():
rotate(0.1)
image(imagePath, (0, 0), 0.6)
spacing = 25.5
pointSize = 126
translate(60.2, 354)
t = "MEHRINGDAMM"
fill(1, 0, 0.2, 0.5)
for c in t:
bez = BezierPath()
bez.text(c, font="Arial Bold", fontSize=pointSize)
xMin, yMin, xMax, yMax = bez.bounds()
bez.translate(-xMin, -yMin)
drawPath(bez)
translate(xMax - xMin + spacing, 0)
saveImage("MEHRINGDAMM_BOXED.jpg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.