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
<html> | |
<head> | |
<script src='http://code.jquery.com/jquery-1.5.1.min.js'></script> | |
</head> | |
<body> | |
<h2>Naive canvas</h2> | |
<canvas id="naive" width="400" height="50"></canvas> | |
<h2>High-def Canvas</h2> |
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
''' Use external module in Drawbot ''' | |
import sys | |
import os | |
# the path to my module: | |
modDir = os.path.expanduser('~/Desktop') | |
# add the path to sys.path | |
if not modDir in sys.path: | |
sys.path.append(modDir) |
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
# Robofont script to remove broken image paths, keeping good ones intact. | |
import os | |
f = CurrentFont() | |
layerOrder = ['foreground'] | |
layerOrder.extend(f.layerOrder) | |
for g in f: | |
for layerName in layerOrder: | |
layeredGlyph = g.getLayer(layerName) |
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
# coding: utf-8 | |
# Sets Robofont’s Mark Colors to OSX’s Crayon colors. | |
# Beware: your old colors will be gone (but they were ugly anyway) | |
from AppKit import NSColorList | |
from mojo.UI import exportPreferences, importPreferences | |
from plistlib import readPlist, writePlist | |
import colorsys | |
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
import os | |
from AppKit import NSBitmapImageRep, NSPNGFileType, NSColor | |
from mojo.UI import CurrentSpaceCenter | |
def export_space_center_to_png(url): | |
sp = CurrentSpaceCenter() | |
sp_view = sp.glyphLineView.getNSScrollView() | |
sp_view.lockFocus() | |
rep = NSBitmapImageRep.alloc().initWithFocusedViewRect_(sp_view.bounds()) |
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.events import BaseEventTool, addObserver | |
from AppKit import NSColor | |
from fontTools.pens.basePen import BasePen | |
from fontTools.pens.cocoaPen import CocoaPen | |
class CocoaGlyphPen(BasePen): | |
def __init__(self, onCurveSize, offCurveSize, selection=[]): | |
self.glyphPen = CocoaPen(None) |
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
# DrawBot script to create an animated version of | |
# "Anthologie zur Visuellen Poesie" by Timm Ulrichs (1968), | |
# as requested by Nick Sherman here: https://www.instagram.com/p/BiAjODfHwCO/ | |
# Thanks to Letterform Archive for sharing. | |
def e_square(x, y, side, rotation): | |
''' | |
Draw letter e in a square defined by its center | |
and the length of the sides. |
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
import os | |
from defcon import Font | |
def remap_item_name(name): | |
''' | |
Remaps a single item name from public.kern style to @MMK style | |
''' | |
if 'public.kern1.' in name: | |
return name.replace('public.kern1.', '@MMK_L_') |
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
''' | |
Create contextual kerning for the /l /periodcenterd /l pair to reproduce | |
the positioning found in the built-in (but obsolete) /ldot glyph. | |
This script expects the /ldot composite glyph to be built from | |
/l and /periodcentered components. | |
''' | |
from defcon import Font |
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
''' | |
Type@Cooper West, June 2018 | |
Contribution to Andy Clymer's "Expanding a Type Family" workshop | |
Script to create joyful GIF animations of interpolated glyphs, | |
either colorful or black & white. | |
''' | |
from fontTools.pens.cocoaPen import CocoaPen |
OlderNewer