This file contains hidden or 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
# MM2SpaceCenter by CJ Dunn, 2019, and licensed under the MIT license. Thanks to Tal Leming, Andy Clymer, David Jonathan Ross, Jackson Cavanaugh, Nina Stössinger for help and inspiration with this script | |
# #when pair changes: get pair and set to space center | |
#you must have a UFO open and have MetricsMachine open | |
import sys, os | |
import random | |
from mojo.UI import CurrentSpaceCenter, OpenSpaceCenter |
This file contains hidden or 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
''' | |
just a proof of concept, name of the second master is hard-coded at the bottom | |
''' | |
from vanilla import FloatingWindow, CheckBox, Slider | |
from defconAppKit.windows.baseWindow import BaseWindowController | |
from mojo.events import addObserver, removeObserver | |
from mojo.UI import CurrentSpaceCenter | |
import mojo.drawingTools as ctx |
This file contains hidden or 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
''' | |
Set search query of frontmost font window in all font windows | |
''' | |
from mojo.UI import AllFontWindows, CurrentFontWindow | |
current_window = CurrentFontWindow() | |
current_query = current_window.getGlyphCollection().getQuery() | |
for font_window in AllFontWindows(): | |
font_window.getGlyphCollection().setQuery(current_query) |
This file contains hidden or 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: which shortkeys are assigned to what action? | |
''' | |
import AppKit | |
import itertools | |
import mojo | |
modifiers = { | |
AppKit.NSEventModifierFlagOption: '⌥', |
This file contains hidden or 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: Smart Close Paths | |
The idea is closing open contours based on point distance rather than | |
membership of a given contour. | |
''' | |
import itertools | |
import math | |
from fontTools.pens.basePen import BasePen |
This file contains hidden or 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
# menuTitle : Tiny Script Window | |
import tempfile | |
import time | |
from pathlib import Path | |
from AppKit import NSApp | |
from vanilla import FloatingWindow, SplitView | |
from lib.scripting.scriptingWindow import PyTextEditor, OutPutEditor | |
from mojo.events import addObserver, removeObserver | |
from mojo.extensions import ( | |
setExtensionDefault, getExtensionDefault, |
This file contains hidden or 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
# Distribute all stickies evenly on the main screen, with optional padding | |
# how many columns? | |
set num_columns to 7 | |
# how many pixels of padding between the stickies? | |
set padding to 20 | |
# Find the dimensions of the main screen | |
# https://stackoverflow.com/questions/1866912/applescript-how-to-get-current-display-resolution |
This file contains hidden or 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
""" | |
Toggle a dark mode in RoboFont. | |
For a dark mode in the Glyph Edit view, install Theme Editor: | |
https://github.com/connordavenport/Theme-Manager | |
...and import the "Dark Connor" theme from this Gist | |
(https://gist.github.com/arrowtype/ce0cee426f47c2fe7e82aa07d1e0a450). | |
Also offers to edit the markColor of glyphs with a high opacity in their markColor, | |
which will disrupt the visual effect of a dark mode on the Font View. However, |
This file contains hidden or 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
# Copyright 2020 Khaled Hosny | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
This file contains hidden or 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
''' | |
table-flip any phrase you like! | |
If the expression contains spaces, please use quotes. | |
python flip_phrase.py fontlab | |
>>> (╯°□°)╯︵ qɐlʇuoɟ | |
''' | |
import sys | |
import unicodedata |