Skip to content

Instantly share code, notes, and snippets.

View roberto-arista's full-sized avatar

Roberto Arista roberto-arista

View GitHub Profile
import fontParts.world as fp
from fontTools.pens.cocoaPen import CocoaPen
def drawGlyph(glyph):
pen = CocoaPen(glyph.getParent())
glyph.draw(pen)
path = pen.path
glyphPath = BezierPath(path=path)
drawPath(glyphPath)
from vanilla import Window, RadioGroup, SquareButton
class ExampleCtrl(object):
ledsAmount = 6
index = 0
def __init__(self):
self.w = Window((150, 150), '% modulo')
self.w.someLeds = RadioGroup((20, 20, -20, -20),
[""]*self.ledsAmount,
#!/usr/bin/env python3
# coding: utf-8
# -------------- #
# impose booklet #
# -------------- #
### Modules
from os import mkdir
from os.path import basename, join, exists
@roberto-arista
roberto-arista / 1D_3states_automata.py
Created August 23, 2021 08:18
One dimensional cellular automata with three states
#!/usr/bin/env python3
"""
One dimensional cellular automata with three states
If you want to know more about CAs check "A New Kind of Science" by Stephen Wolfram
https://www.wolframscience.com/nks/
"""
### Modules
#!/usr/bin/env python3
from math import hypot
from mojo.subscriber import Subscriber, WindowController
from mojo.subscriber import registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber
from mojo.roboFont import OpenWindow
from vanilla import FloatingWindow, CheckBox

EZML Syntax Basics

# comment
whitespace has no meaning except single spaces used to separate important things
@ is an identifier
() means button of some sort
[__] means text entry of some sort (except checkbox)
{} means image
- means line