Skip to content

Instantly share code, notes, and snippets.

from coldtype import *
from coldtype.fx.skia import phototype
rs = random_series(-(r:=30), r, seed=0)
@animation((1080, 1080), bg=0, tl=120)
def slicer(f):
s = Scaffold(f.a.r.inset(-500, 0))
s.grid(41, 1)
@stenson
stenson / hobeauxborders.py
Created November 8, 2022 20:07
for use with new scripting tab in ST2
from coldtype import *
# make sure to select hobeaux borders otf
# in the ST2 font picker in Blender
# (or else this script won’t work)
styles = [ # the number in the text box in ST2
"Aa ", "B ", "Cc3", "Dd4", "Ee5",
"Ff6", "Gg ", "Hh8", "Ii9", "Jj0",
"Kk!", "Ll@", "Mm#", "Nn$", "Oo%",
from coldtype import *
from coldtype.fx.skia import precompose
# inspired by https://mauricemeilleur.net/truchet_tiles
rs = random_series(0, 3)
rs2 = random_series()
tr = Rect(100)
tn = 8
from coldtype import *
# Generic Style-to-blackrenderer.render.renderText mapping function
import tempfile
from coldtype.img.skiaimage import SkiaImage
from blackrenderer.render import renderText
def blackrender(text, style:Style):
with tempfile.NamedTemporaryFile("wb", suffix=".png", delete=False) as tf:
@stenson
stenson / contours.py
Created February 17, 2022 19:27
contours
from coldtype import *
rs1 = random_series()
@renderable((1080, 540))
def contours1(r):
return (StSt("ASDF", "Madtown", 300)
.align(r)
.mapv(lambda i, p: p
.removeOverlap()
from coldtype import *
chars = "ABCDEFGHIJKLMNOPQRSTUVWXY&Z"
lines = ["", " ", " "]
for idx, c in enumerate(chars):
lines[idx%3] = lines[idx%3] + c + " "
at = AsciiTimeline(5, 18, f"""
<
{lines[0]}
from coldtype import *
chars = "ABCDEFG"
count = len(chars)
fnt = Font.Cacheable("~/Type/fonts/fonts/plakato/PlakatoDraw.ttf")
@animation(timeline=Timeline(35*count, 30), bg=0, render_bg=1)
def animall(f):
e, lidx = f.e("qeo", count, loop_info=1)
@stenson
stenson / plakato_draw_3d.py
Created December 29, 2021 02:41
plakato draw variating in 3d
from coldtype import *
from coldtype.blender import *
keyframes = dict()
for x in range(0, 4):
keyframes[f"{x}0"] = dict(ANIM=0)
keyframes[f"{x}1"] = dict(ANIM=1)
at = AsciiTimeline(2, 24, """
<
@stenson
stenson / plakato1.py
Last active April 9, 2022 13:45
playing with plakato and image feedback
from coldtype import *
from coldtype.fx.skia import phototype, luma, precompose, fill
from coldtype.warping import warp
fnt = Font.Find("PlakatoPlay.*I")
rs = random_series(0, 1000)
txt = "VERY\nVARI-\nABLE"
@animation((1080, 1080), tl=Timeline(60, 24), bg=0, render_bg=1, composites=1)
def plak2(f):
# Andy Clymer’s DrawBot icon,
# slightly modified to work in Coldtype
# original source: https://www.drawbot.com/content/drawBotIcon.html
# modifications: moved timing and output to
# coldtype’s @drawbot_animation decorator
# to get drawbot in your virtualenv:
# pip install git+https://github.com/typemytype/drawbot