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.subscriber import Subscriber, WindowController | |
from mojo.subscriber import registerRoboFontSubscriber, unregisterRoboFontSubscriber, listRegisteredSubscribers | |
from mojo.UI import CurrentSpaceCenter, OpenSpaceCenter | |
import ezui | |
from random import randint | |
# based on a EvB snippet | |
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.UI import AllFontWindows, NumberEditText | |
from mojo.subscriber import Subscriber, registerFontOverviewSubscriber | |
from AppKit import NSColor, NSTextAlignmentRight | |
from mojo.UI import CurrentFontWindow, getDefault, setDefault | |
''' | |
[email protected] | |
for robofont | |
replace the fuzzy cell size slider with a crispy number field | |
set as a start up script |
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 : Current UFO to Front | |
# shortCut : command+control+] | |
from AppKit import * | |
from mojo.UI import CurrentWindow, CurrentGlyphWindow, AllFontWindows, AllGlyphWindows | |
def current_to_front(): |
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
f = CurrentFont() | |
for g in f.selectedGlyphs: | |
if len(g.components) > 0: | |
with g.undo('Nested Decompose ' + g.name): | |
for component in g.components: | |
baseGlyph = f[component.baseGlyph] | |
if len(baseGlyph.components) > 0: | |
pen = g.getPointPen() | |
baseGlyph.drawPoints(pen) | |
g.removeComponent(component) |
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: Sort Script Menu | |
import AppKit | |
from mojo.tools import CallbackWrapper | |
from mojo.subscriber import Subscriber, registerRoboFontSubscriber, registerSubscriberEvent, getRegisteredSubscriberEvents | |
class sort_script_menu(Subscriber): |
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
// indesign script | |
// apply a random transformation to each selected objects | |
// 2024 [email protected] | |
function rotate_objects(params) { | |
var rotate_range = parseFloat(params[0]) | |
var x_range = params[1] |
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.subscriber import Subscriber, registerRoboFontSubscriber | |
# set as a startup script | |
# open new scripting windows with preset code | |
# requires Robofont beta 2401051907 (5 January 2024) or later | |
# [email protected] | |
preset = '''# a = AllFonts() |
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 vanilla import * | |
from AppKit import NSEvent, NSShiftKeyMask, NSCommandKeyMask, NSAlternateKeyMask, NSControlKeyMask | |
class Test_Only_CheckBox(): | |
def __init__(self): | |
u = 22 | |
self.w = Window((250, u*10), 'Test_Only_CheckBox') | |
self.w.check_0 = CheckBox((5, u*0, -5, u), 'Check 0', value=True, callback=self.checks) |
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 sub import * | |
class this(): | |
def __init__(self): | |
self.x = 2 | |
y = sub_test(self) | |
print(y) | |
this() |
NewerOlder