Skip to content

Instantly share code, notes, and snippets.

@adbac
adbac / italic-selection-tool.py
Last active January 30, 2026 17:20
Italic selection marquee tool
# Originally written by Frederik Berlaen
# see discussion here: https://discord.com/channels/1052516637489766411/1466071066240614444
from math import radians, tan
from mojo.events import EditingTool, installTool
from mojo.UI import appearanceColorKey, getDefault
class ItalicAngleEditTool(EditingTool):
@adbac
adbac / scrolling-merz-view-cursor.py
Created October 29, 2025 13:47
Change cursor inside ScrollingMerzView
"""
Set a cursor (custom or native) for a ScrollingMerzView
using the underlying NSScrollView
"""
import AppKit
import ezui
import merz
class Demo(ezui.WindowController):
@adbac
adbac / MagneticMetrics2.py
Last active April 8, 2026 19:31
A new version of ProductionType's magneticMetrics script, updated for RoboFont 4 (using the Subscriber and merz modules)
"""
v.2.3
Observer to make sidebearings magnetic to outline modifications.
Its aim to be used as a startup script so it can be activated and deactivated whenever you need.
Version history:
ProductionType:
- v1.002: first private release
- v1.003: fix magnet multiple drawing
@adbac
adbac / zipFolder.py
Created February 23, 2025 22:15
Python script to zip a folder without macOS metadata like .DS_Store files (and the _MACOSX folder, normally).
import os
import zipfile
from pathlib import Path
def zipFolder(zipDir, sourcePath, excludePatterns=[]):
"""
Zips a folder and its contents, without macOS metadata like `.DS_Store` files.
*zipDir* is the path to the directory to put the zip file in,