Skip to content

Instantly share code, notes, and snippets.

View roberto-arista's full-sized avatar

Roberto Arista roberto-arista

View GitHub Profile
@roberto-arista
roberto-arista / drawPoly.pde
Last active August 29, 2015 13:59
drawPoly.pde
void drawPoly(float x, float y, float radius, int numEdges) {
float arc = TWO_PI / numEdges;
beginShape();
for (int i=0; i<numEdges; i++) {
float a = arc * i;
float px = x + cos(a) * radius;
float py = y + sin(a) * radius;
@roberto-arista
roberto-arista / fromUfoToDrawbot.py
Last active August 29, 2015 14:01
From UFO Robofab to Drawbot context
### Module
from robofab.world import OpenFont
### Functions
def drawCon(con):
bezierPath = BezierPath()
# Iteration over segments
for seg in con:
@roberto-arista
roberto-arista / typefaceOrientedGrid.py
Last active September 12, 2020 23:51
Typeface Oriented Grid Generator – open with Drawbot and launch!
####################################
# Typeface oriented grid generator #
####################################
"""
Usage:
- open .py file with Drawbot (drawbot.readthedocs.org) and launch
- use what the script prints out to set your InDesign document
"""
@roberto-arista
roberto-arista / dominanti_cromatiche.py
Last active August 29, 2015 14:02
This script helps you dividing raster images by dominant colors. You can modify the benchmark_colors dictionary as you wish. Dependencies: PIL
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#################################################
# Organizing images by dominant colors with PIL #
#################################################
### Modules
from PIL import Image, ImageStat
import os
@roberto-arista
roberto-arista / gazePosition_visualization.py
Last active August 29, 2015 14:02
A Python/Drawbot script able to visualize gaze_position.npy by Pupil Capture eye-tracker
################################
# Gaze positions visualization #
################################
### Modules
import numpy
import sys
from operator import itemgetter
### Functions
@roberto-arista
roberto-arista / hapaxator.py
Last active August 29, 2015 14:09
This script is able to reorder by occurrences a txt file. It returns two different txt files, words and punctuation. It is possible to choose the direction of the ordering action: increasing or decreasing.
# Copyright (c) 2013, Federico Antonini e Roberto Arista
# MIT License
# Hapax script
### Opening libraries
import string
import re
import sys
from operator import itemgetter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#############
# Zip ufos! #
#############
### Modules
import zipfile
import os
@roberto-arista
roberto-arista / colorManager.py
Created February 25, 2015 09:15
Vanilla color manager for Robofont font editor
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#################
# Color manager #
#################
### Modules
from vanilla import Window, Group, ColorWell, TextBox, HorizontalLine
from AppKit import NSColor
@roberto-arista
roberto-arista / adding_smart_set.py
Created February 25, 2015 09:24
Adding smart sets to Robofont
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#####################
# Adding smart sets #
#####################
### Modules
import os
from mojo.UI import SmartSet, addSmartSet
@roberto-arista
roberto-arista / drawWiggle.py
Created April 17, 2017 15:46
Draw wiggles using Python and Drawbot
##############################
# Draw Wiggles using Drawbot #
##############################
"""
Script by Roberto Arista, you can find the related tutorial here: https://medium.com/@roberto_arista/how-to-draw-a-wiggle-between-two-points-with-python-and-drawbot-788006c18fb0
You can find drawbot here: http://www.drawbot.com/
Code distributed with no guarantee, use at your own risk
"""