Skip to content

beesandbombs/coldtype

 
 

Repository files navigation

⚠️🌋 Disclaimer: this library is alpha-quality; the API is subject to change 🌋⚠️


Coldtype

Hello and welcome to coldtype, an odd little library for programmatic typography, written for use on Goodhertz projects and text animations.

For installation and tutorials, check out coldtype.goodhertz.com

Here’s a quick example:

from coldtype import *

@renderable((1580, 350))
def render(r):
    c1 = hsl(0.65, 0.7)
    c2 = hsl(0.53, 0.6)

    return DATPenSet([
        (DATPen()
            .rect(r.inset(10))
            .outline(10)
            .f(Gradient.Horizontal(r,
                c2.lighter(0.3),
                c1.lighter(0.3)))),
        (StyledString("COLDTYPE",
            Style("assets/ColdtypeObviously-VF.ttf", 250,
                wdth=1, tu=-170, r=1, rotate=15,
                kp={"P/E":-150, "T/Y":-50}))
            .pens()
            .align(r)
            .f(Gradient.Horizontal(r, c1, c2))
            .understroke(s=1, sw=5))
            .translate(0, 5)])

Running that code results in this image popping up on your screen in a dedicated window:

An example

Documentation

Check out coldtype.goodhertz.com for instructions on installing and getting started with coldtype.

More Examples

The best way to get familiar with Coldtype is to look at and try modifying some example code, like the animating gif below. To try out this example and many more, check out the examples/animation directory in this repo.

About

cross-platform display typography in python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 87.7%
  • JavaScript 11.2%
  • Other 1.1%