This file contains 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: Consolidate Selected Point Pairs | |
# shortCut : shift + control + f | |
from fontTools.misc.fixedTools import otRound | |
MAKE_INTO_ONE_POINT = True | |
def average(lst): |
This file contains 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: Accept SVGs from Figma (Start-up script) | |
''' | |
An RF start-up script that allows inbound SVG data from Figma via pasteboard. | |
Should work on simple shapes, might not work for others. | |
Ryan Bugden | |
''' | |
import AppKit |
This file contains 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: Rotate 180 - All Layers | |
# shortCut: shift + command + r | |
''' | |
A script that rotates your glyph and all of its layers. | |
It does its best to rotate it in a helpful way, not | |
necessarily just around the body of the contours themselves. | |
Use your preferred shortcut in line 2. | |
Ryan Bugden |
This file contains 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: Add Missing Characters from Clipboard Text | |
import collections | |
from glyphNameFormatter import GlyphName | |
from AppKit import NSPasteboard, NSPasteboardTypeString | |
f = CurrentFont() | |
templ_gs = f.templateGlyphOrder | |
pasteboard = NSPasteboard.generalPasteboard() |
This file contains 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 : Make Two Selected Lines Parallel | |
import math | |
def sortTuple(tup): | |
# sort line coordinates in ascending y order | |
tup.sort(key = lambda x: x[1]) | |
return tup | |
g = CurrentGlyph() |
This file contains 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 : Generate Instances from Designspaces | |
from ufoProcessor import build | |
from mojo.UI import GetFile | |
paths = GetFile( | |
message='Select all designspaces, the instances of which you want to generate.', | |
title='Generate Instances', | |
allowsMultipleSelection=True | |
) |
This file contains 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 : Mark Undrawn Glyphs from SC Red | |
from mojo.UI import CurrentSpaceCenter | |
from glyphNameFormatter.tools import charToUnicode | |
f, csc = CurrentFont(), CurrentSpaceCenter() | |
text = csc.getRaw() | |
color = (1, 0, 0, 1) #red | |
for letter in text: |
This file contains 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 : Make All Glyph Names Human Readable | |
from lib.tools.unicodeTools import GN2UV | |
def get_key(val, di): | |
for key, value in di.items(): | |
if val == value: | |
return key | |
f = CurrentFont() |
This file contains 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 : Open Glyph Preview Window | |
from vanilla import FloatingWindow | |
from mojo.glyphPreview import GlyphPreview | |
from mojo.roboFont import OpenWindow | |
from mojo.events import addObserver, removeObserver | |
from lib.tools.misc import rgbaToNSColor | |
class GlyphPreviewWindow: | |
This file contains 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.UI import CurrentSpaceCenter | |
from vanilla import FloatingWindow, Slider, TextBox | |
from AppKit import NSColor | |
from mojo.events import addObserver, removeObserver | |
class SpaceCenterTuner(): | |
""" | |
Fine-tune Space Center sizing and spacing. | |
Ryan Bugden |