Created
April 16, 2020 19:18
-
-
Save justvanrossum/443186a8b06d9eb9e6463e94b91630e3 to your computer and use it in GitHub Desktop.
MEHRINGDAMM: Spacing by bounding box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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