Skip to content

Instantly share code, notes, and snippets.

typemytype / install_liquid_c_on_Monterey
Created Jan 22, 2022
command to install liquid-c on Monterey
View install_liquid_c_on_Monterey
gem install liquid-c -- --with-cflags="-Wno-compound-token-split-by-macro"
import vanilla
import merz
class Demo:
def __init__(self):
# setup window
self.w = vanilla.Window((400, 400), minSize=(150, 150))
import AppKit
import webbrowser
import urllib
import json
import os
import ssl
import vanilla
from mojo.extensions import ExtensionBundle
# get the current glyph
glyph = CurrentGlyph()
# get the point pen
pointPen = glyph.getPointPen()
# loop over all contours
# convert the glyph to a list first
# so we can remove the contour and alter the glyph
for contour in list(glyph):
# get all the points
points = contour.points
def lerp(value1, value2, factor):
return value1 + (value2 - value1) * factor
size(400, 400)
R = (sqrt(5) - 1) / 2
def F(x1, y1, r, s, t, n):
x, y = 0, 0
w = h = 200
circles = 3
offset = 20
thickness = 26
color1 = (0, 1, 1)
color2 = (1, .5, 0)
color3 = (1, 0, 1)
color4 = (1, 1, 0)
typemytype /
Last active Nov 2, 2020
Collect windows by the type of window in RoboFont
import vanilla
import AppKit
class WindowTabCollector:
windowNames = [
from AppKit import *
t = """Yeah! A designspace is file that contains the plans for an interpolation system for a typeface. It describes how the source fonts relate and how they should interpolate. It defines the dimensions in which the typeface developes, for instance “weight”, “width”, or other things. A designspace also stores information about the instances, specific locations in the designspace that are interesting and what they need to be called. Designspaces can be used to build variable fonts, but you can also use them to generate fixed UFOs. This text is an introduction to designspace construction. It does not go into detail how to design letterforms for interpolation, or things like family planning. That is for other chapters. To avoid getting tangled in typographic terminology, the dimensions in this text are named after colors."""
synth = NSSpeechSynthesizer.alloc().initWithVoice_("")
from math import sqrt
class AnimationFrame(object):
def __init__(self, index, factor):
self._index = index
self._factor = factor
def index(self):
return self._index
import AppKit
import vanilla
from import ClassNameIncrementer
class SpeechRecognizerDelegate(AppKit.NSObject, metaclass=ClassNameIncrementer):
def speechRecognizer_didRecognizeCommand_(self, recognizer, command):