Skip to content

Instantly share code, notes, and snippets.

@connordavenport
Last active May 5, 2024 02:14
Show Gist options
  • Save connordavenport/b2c4b1b6a7e12dc851a5a369f07500ee to your computer and use it in GitHub Desktop.
Save connordavenport/b2c4b1b6a7e12dc851a5a369f07500ee to your computer and use it in GitHub Desktop.
font("Zapata-Light")
w,h,b,o,i,q=width(),height(),(0,.05,.1),(.9,.2,0),0,.75
def nfs(wi,wd):
fontSize(20)
return(wd/textSize(wi)[0])*20
fill(*b)
rect(0,0,w,h)
for wr in "YOU NEED PYTHON".split():
fill(*o)if wr[0]!="P"else fill(1)
fs=nfs(wr,w-40)
fontSize(fs)
i+=fs
yp=h-i*q
text(wr,(20,yp))
b=BezierPath()
b.text("π",font=fontFilePath(),fontSize=nfs("π",w*q))
X,Y,W,H=b.bounds()
translate(((w-(W-X))/2)-X,(yp-H)*.92)
fill(*o)
drawPath(b)
p=BezierPath()
[p.moveTo(*segment) if i == 0 else p.curveTo(*segment) for ii,c in enumerate(b.contours[1:3]) for i, segment in enumerate(c)]
p.closePath()
fill(1)
drawPath(p)
@connordavenport
Copy link
Author

image

@connordavenport
Copy link
Author

youneedpython

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment