Skip to content

Instantly share code, notes, and snippets.

View ddaanniiieeelll's full-sized avatar
🕴️

Daniel ddaanniiieeelll

🕴️
View GitHub Profile
@typemytype
typemytype / tabCollector.py
Last active January 18, 2024 09:19
Collect windows by the type of window in RoboFont
import vanilla
import AppKit
class WindowTabCollector:
windowNames = [
"GlyphWindow",
"FontWindow",
"SpaceCenter",
"ScriptingWindow",
@frankrolf
frankrolf / segment_structure.py
Last active November 8, 2020 17:22
Robofont script to validate segment structure across fonts
'''
Print out segment structure for current glyph in all open fonts.
If the structure matches, only one line will be printed:
a 0 ⤴️📈📈⤴️⤴️⤴️⤴️📈⤴️⤴️⤴️ 1 ⤴️📈⤴️⤴️📈⤴️⤴️⤴️⤴️📈📈⤴️⤴️📈📈⤴️ ✔
If it does not, the structure of all open fonts will be printed for comparison:
@LettError
LettError / drawbot_generate_teams_background.py
Created May 8, 2020 14:39
Generate a background for Teams with drawbot
import os
from os.path import expanduser
home = expanduser("~")
backgroundFolder = os.path.join(home, "Library/Application Support/Microsoft/Teams/Backgrounds/Uploads")
size(1920, 1080)
s = 10
sw = int(width()/s)
@thundernixon
thundernixon / check-num_points-selected_fonts.py
Created August 12, 2019 00:51
A RoboFont script to print a report of all mismatching counts of on and off-curve points in selected fonts, to help achieve interpolation compatibility.
from vanilla.dialogs import *
from mojo.UI import AskString
from mojo.UI import OutputWindow
import pprint
######## Spaced-separated list of glyphs to ignore in check (e.g. experimental glyphs) ########
glyphsToIgnore = ""
###############################################################################################
@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):
"atom-shell-commands":
commands: [
{
arguments: [
"-p"
"{FilePath}"
]
command: "roboFont"
name: "build robofont"
options:
@LettError
LettError / unicodeStyleWriter.py
Created February 28, 2019 14:24
A small converter from normal latin AZ,az to the Unicode math alphabets.
import vanilla
""" Unicode Stylewriter: Use the unicode styles to impress friends and families on the internet. """
class StyleWriter(object):
styles = [
dict(title="𝔸", upper=0x1D538, lower=0x1D552, name='mathdoublestruck'),
dict(title="𝖠", upper=0x1D5A0, lower=0x1D5BA, name='mathsans'),
dict(title="𝗔", upper=0x1D5D4, lower=0x1D5EE, name='mathsansbold'),
dict(title="𝐴", upper=0x1D434, lower=0x1D44E, name='mathitalic'),
dict(title="𝐀", upper=0x1D400, lower=0x1D41A, name='mathbold'),
{
"cmd": ["robofont", "-p", "$file"],
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
"selector": "source.python",
}
@frankrolf
frankrolf / drawbot_interpolate_glyph_gif.py
Created June 3, 2018 23:16
DrawBot script to create joyful GIF animations of interpolated glyphs
'''
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
@LettError
LettError / comments.py
Created May 24, 2018 08:35
Drawbot sketch for drawing scribbles.
size(1000,400)
def scribble(pos, width, amplitude):
save()
x, y = pos
start = x
strokeWidth(1)
fill(None)
stroke(1-random()*0.2,0,0)