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: Set the Latest Kern Value | |
# shortCut: pagedown | |
from mojo.UI import getDefault | |
import metricsMachine as mm | |
KERN_VALUE_LIB_KEY = 'com.ryanbugden.storeLatestKernValue.kernValue' | |
def get_kern_group(f, glyph, side): | |
if side == 'left': |
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: Scale While Slanted | |
import ezui | |
from mojo.extensions import getExtensionDefault, setExtensionDefault | |
from fontTools.misc.transform import Transform | |
from math import radians | |
EXTENSION_KEY = "com.ryanbugden.scaleWhileSlanted.settings" | |
EXTENSION_DEFAULTS = { |
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 |