This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BG = 1500 | |
NSQUARES = 50 | |
SQUARESIZE = 2000 | |
NFRAMES = 96 | |
TOTALROTATION=15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import seed | |
from fontTools.pens.basePen import BasePen | |
rad = width()/4 | |
nFrames=40 | |
class BezierPathPen(BasePen): | |
"""FontTools pen -> BezierPath adapter.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xlrd import open_workbook | |
wb = open_workbook('simple.xls') | |
for s in wb.sheets(): | |
print 'Sheet:',s.name | |
for row in range(s.nrows): | |
values = [] | |
for col in range(s.ncols): | |
values.append(s.cell(row,col).value) | |
print ','.join(values) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size(500,500) | |
txt="how \n to \n deal?" | |
path = BezierPath() | |
path.text((txt), font="Helvetica", fontSize=150, offset=(2, 380)) | |
NLINES=100 | |
def makelines(amt): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
canvas=500 | |
divider=10 | |
# made in drawbot - drawbot.com # | |
### this is a 'grid builder' that does the math separates the grid into random integers that add up to fill the entire thing. The variance in randomness can be controlled with the multiplier on the variance variable. we will use two arrays from this function, one to build rows, and the other to build columns. I based it off code found here: http://sunny.today/generate-random-integers-with-fixed-sum/ ### | |
def generate_random_integers(_sum, n): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mojo.UI import * | |
f=CurrentFont() | |
g=FindGlyph(f) | |
for k in AllFonts(): | |
OpenGlyphWindow(k[g.name]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def makePairs(path, stylename, maxVal, minVal): | |
separatemasters(path, maxVal, minVal) | |
listName = [] | |
for f in maxFonts: | |
if stylename in f: | |
listName.append(f) | |
for m in minFonts: | |
if stylename in m: | |
listName.append(m) | |
return(list(dict.fromkeys(listName))) #list(dict.fromkeys(x)) is a good way to get a list with stripped duplicates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# creates a Markdown table in Python using a designspace file, outlining instance names and corresponding axis values | |
import markdown | |
from fontTools.designspaceLib import DesignSpaceDocument | |
instanceNameString = "| Instance Name |" | |
filePath = "file_name_here.designspace" | |
def carpenter(designSpaceFile): | |
headerString = "" |