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 the pair list of an open MetricsMachine (extension) window | |
| from all kerning pairs (sorted by glyph order) to exceptions and back. | |
| ''' | |
| import metricsMachine | |
| import mm4 | |
| f = CurrentFont() |
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
| ''' | |
| 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: |
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
| import math | |
| def calc_vector(p1, p2): | |
| x1, y1 = p1 | |
| x2, y2 = p2 | |
| return x2 - x1, y2 - y1 | |
| def calc_distance(p1, p2): |
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 startup script to find out which kerning group | |
| the selected glyph belongs to. | |
| ''' | |
| import AppKit | |
| from mojo.UI import CurrentFontWindow | |
| from mojo.events import addObserver | |
| from mojo.roboFont import CurrentFont |
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
| ''' | |
| Open different space centers based on figure figure_suffixes given below | |
| ''' | |
| from mojo import UI | |
| from AppKit import NSApp, NSScreen, NSMakeRect | |
| # figure_suffixes = ('', '.lf', '.tosf', '.osf', '.sc', '.sups') | |
| figure_suffixes = ('', '.lf', '.tosf', '.osf') |
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 |
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
| ''' | |
| TikToggle | |
| - toggle glyph windows | |
| - toggle the current space center to correspond to the frontmost glyph | |
| suggested shortcut: ctrl - ↑ | |
| toggle_backward.py also exists: | |
| suggested shortcut: ctrl - ↓ |
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
| from mojo.events import addObserver | |
| import mojo | |
| VERSION = mojo.roboFont.version | |
| class FloatObserver(object): | |
| def __init__(self): | |
| # addObserver(self, 'saveCallback', 'fontWillClose') | |
| addObserver(self, 'saveCallback', 'fontWillSave') |
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, |