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 | |
class SpaceCenterTuner(): | |
""" | |
Fine-tune Space Center sizing and spacing. | |
Ryan Bugden | |
2020.05.18 | |
2019.06.02 |
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 CurrentFontWindow | |
from lib.tools.defaults import getDefault | |
''' | |
trying to perfectly fit 16 columns of cells across the font overview | |
''' | |
fo = CurrentFontWindow().fontOverview | |
gc = fo.getGlyphCollection() | |
v = gc.getGlyphCellView() |
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 : Scramble Selected Glyphs | |
from random import choice | |
f = CurrentFont() | |
# grab selection | |
gs = f.selectedGlyphNames | |
new_assign ={} |
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 |
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
# 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 : 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 : 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 : 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: 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() |
OlderNewer