Skip to content

Instantly share code, notes, and snippets.

@okay-type
okay-type / spacecenter-next-line.py
Last active September 19, 2019 16:43
Go to the next line of Input Text in Robofont's Space Center
# Go to the next line of Input Text in Robofont's Space Center
from mojo.UI import CurrentSpaceCenter
from difflib import get_close_matches
class SpacecenterNext(object):
def __init__(self):
sp = CurrentSpaceCenter()
tgli = sp.top.glyphLineInput
items = tgli.getItems()
@okay-type
okay-type / markcolor-in-glyphoverlayview.py
Last active September 12, 2019 10:24
show the current glyph's mark color in robofont's glyph window
from vanilla import *
import mojo.drawingTools as ctx
from mojo.events import addObserver, removeObserver
from mojo.canvas import CanvasGroup
from mojo.UI import CurrentGlyphWindow
s = 50
class MarkyGlyph(object):
@okay-type
okay-type / send-email.py
Created May 16, 2019 21:32
send email from python
import smtplib
# this uses a burner gmail account to send from
# I use this to email my phone's sms email
email = 'to@email.com'
text = 'hello sms'
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login('burner@gmail.com', 'password')
server.sendmail('Robofont', email, text)
@okay-type
okay-type / bulk-list.py
Last active September 19, 2019 18:59
dropfile-ui
# jackson # ok@yty.pe
# version 0.3 - conditional status icons
import os
from AppKit import NSFilenamesPboardType, NSDragOperationCopy
from vanilla import Window, List, Button
action = 'Do Thing'
class doThing():
import os
import sys
sys.path.append("..")
import subprocess
# size
pW, pH = 612, 612
# timing for animation
@okay-type
okay-type / blank-addobserver.py
Last active May 9, 2021 18:20
blank-addobserver.py
# menuTitle : my funky script
# shortCut : command+q
# command+shift+control+alt+<input>
# character space tab backtab arrowup arrowdown arrowleft arrowright f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24 f25 f26 f27 f28 f29 f30 f31 f32 f33 f34 f35 enter backspace delete home end pageup pagedown
from vanilla import *
from mojo.events import addObserver, removeObserver
from AppKit import NSApp
@okay-type
okay-type / test-preferences.py
Last active October 22, 2019 15:37
Testing saving/loading preferences in robofont
from vanilla import Window, EditText, Button
from mojo.extensions import setExtensionDefault, getExtensionDefault, registerExtensionDefaults, removeExtensionDefault
class preferenceTest(object):
def __init__(self):
self.windowname = 'pref save / load test'
self.prefKey = 'com.okaytype.toolName'
self.makeWindow()
@okay-type
okay-type / quick-startpoint.py
Created October 1, 2019 16:21
quickly set start points in robofont
# quick and dirty auto start points
# set a command+shift+t keyboard shortcut to match prepolator
def getKey1(item): return item[1]
def getKey0(item): return item[0]
g = glyph = CurrentGlyph()
g.prepareUndo("Lazy Startpoint")
@okay-type
okay-type / toggle font window toolbar.py
Last active May 4, 2020 18:21
toggle font window toolbar in robofont
# menuTitle : Toggle Font Toolbar
# shortCut : command+alt+`
from mojo.UI import AllFontWindows
'''
toggle the visibility of the toolbar and the status bar in robofont's font overview window
sorry, i haven't tested this in single window mode or anything
'''
@okay-type
okay-type / interpolated-spacecenter.py
Last active February 25, 2020 12:11
A very simple, very rough interpolated spacecenter window for Robofont
# menuTitle : Interpolated Preview
'''
v 0.2
jackson @ okaytype
to do:
- clean up imports
- better performance
- needs a smarter, cheaper redraw trigger
- only redraw/reinterpolate the current glyph when changed, keep others