Skip to content

Instantly share code, notes, and snippets.

View frankrolf's full-sized avatar
😸
meow

Frank Grießhammer frankrolf

😸
meow
View GitHub Profile
@LettError
LettError / responsive_drawbot_animated.py
Created December 4, 2023 11:19
Drawbot output for responsive lettering UFO
#
# script for drawbot extension in robofont
# draws a fitted / interpolating image from a responsive lettering ufo
# erik@letterror.com / 20231204
def ip(a, b, f):
return a + f * (b-a)
page = (659, 500) # image size
margin = 59 # nice to have a margin
# menuTitle : Headless RoboFont
import os
import AppKit
import ezui
from mojo.extensions import getExtensionDefault, setExtensionDefault
from mojo.subscriber import Subscriber, registerRoboFontSubscriber
from mojo.UI import AskString, OpenGlyphWindow, OpenSpaceCenter, OpenFontInfoSheet
defaults_key = 'com.typemytype.headLessRoboFont.glyphName'
@connordavenport
connordavenport / SyncMMWindows.py
Last active June 6, 2023 16:18
A small script to keep certain MM windows in sync
import metricsMachine
from mm4.mmScripting import MetricsMachineScriptingError
from vanilla import FloatingWindow, List, CheckBox, PopUpButton
from mojo.events import addObserver, removeObserver
from AppKit import *
from mojo.UI import Message
class SyncMM:
def __init__(self):
@jo-lang
jo-lang / timm_ulrichs_rotating_e.py
Created November 19, 2020 12:46
Interpretation of a work by Timm Ulrichs to be run in drawbot app
'''
An interpretation of a work by Timm Ulrichs
see this blog post: https://letterformarchive.org/news/shaped-text
See other solutions in this twitter-thread:
https://twitter.com/MauriceMeilleur/status/1329218247594561538
'''
# ---------------
# S E T T I N G S
"""
Open a bunch of ufos, select a bunch of interestng glyphs in a font window and run this.
As a nice bonus, this is also a way to reduce the scope of the the next and previous glyph hotkeys.
"""
from mojo.UI import SmartSet, AllFontWindows
f = CurrentFont()
for w in AllFontWindows():
@LettError
LettError / angleRatioTool.py
Created February 28, 2019 09:57
EditTool script for RoboFont 3. Show the ratio between the length of incoming and outgoing sections of bcps and tangents.
import AppKit
from mojo.events import installTool, EditingTool, BaseEventTool, setActiveEventTool
from mojo.drawingTools import *
from mojo.UI import UpdateCurrentGlyphView
from defconAppKit.windows.baseWindow import BaseWindowController
import math
#
#
# A visualisation for RoboFont
{
"cmd": ["robofont", "-p", "$file"],
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
"selector": "source.python",
}
@brechtm
brechtm / diffpdf.sh
Last active May 17, 2024 15:56
Page-by-page PDF diff tool
#!/bin/bash
# usage: diffpdf.sh file_1.pdf file_2.pdf
# requirements:
# - ImageMagick
# - Poppler's pdftoppm and pdfinfo tools (works with 0.18.4 and 0.41.0,
# fails with 0.42.0)
# (could be replaced with Ghostscript if speed is
# not important - see commented commands below)
@theMikeD
theMikeD / Make Ready Folder.jsx
Created February 14, 2015 18:37
Photoshop script to create a folder if it doesn't already exist
#target photoshop
// Mini-Script to create a folder if it doesn't already exist.
// This one requires editing by the end user.
// (c) Mike Dickson www.photoshoptools.ca
// Licensed under the GPL
// You will need to edit this location for your own uses
var f = new Folder("~/Desktop/sRGB Blog Images");
if ( ! f.exists ) {
@asimihsan
asimihsan / !resuilts.md
Created February 28, 2014 17:29
HTML5 canvas drawing tabular data for massive (50k+) coloured, interactive, tables.

With click handlers

  • 5k rows takes <1s.330MB!
  • 10k rows takes <2s, 700MB!!