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.subscriber import Subscriber, registerRoboFontSubscriber | |
from mojo.UI import SetCurrentGlyphByName | |
''' | |
keep track of the most recent currentGlyph and return to it using ⇧+, | |
recent update: | |
no longer tied to the edit glyph window - you can now close a glyph, open a new glyph, and then ⇧+, back to the previous glyph | |
''' |
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 AppKit import NSScreen | |
from vanilla import * | |
import merz | |
import mojo.subscriber as subs | |
from mojo.subscriber import Subscriber, WindowController, registerCurrentGlyphSubscriber, registerGlyphEditorSubscriber, registerSubscriberEvent, getRegisteredSubscriberEvents, unregisterGlyphEditorSubscriber, listRegisteredSubscribers | |
from mojo.extensions import registerExtensionDefaults, setExtensionDefault, getExtensionDefault, removeExtensionDefault | |
from mojo.drawingTools import * | |
from math import radians, tan, pi | |
from AppKit import NSColor | |
from fontTools.pens.basePen import BasePen |
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.subscriber import Subscriber, registerGlyphEditorSubscriber | |
from vanilla import * | |
from AppKit import NSColor, NSAttributedString, NSForegroundColorAttributeName, NSFontAttributeName, NSFont, NSTextAlignmentLeft, NSTextAlignmentRight | |
''' | |
Lazily check the position of anchors in dependent glyphs, like small-caps | |
and tries to see if they match their position in the parent glyphs | |
it assumines a few things based on my workflow: | |
- assumes small-caps are named lowercase with a '.sc' suffix e.g.: A -> a.sc |
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.subscriber import Subscriber, registerGlyphEditorSubscriber | |
from vanilla import Button | |
import merz | |
from merz.tools.drawingTools import NSImageDrawingTools | |
''' | |
[ Print Glyph ] | |
dumps code to draw the current glyph as a symbol | |
copy/paste it into the symbol factory at the bottom |
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.subscriber import Subscriber, registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber | |
from vanilla import Button | |
import merz | |
class merzViewDelegateTest(Subscriber): | |
debug = True | |
def build(self): |
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 vanilla import * | |
from mojo.UI import CurrentGlyphWindow | |
from mojo.events import addObserver, removeObserver | |
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber | |
from merz import * | |
from AppKit import NSColor, NSTextAlignmentRight, NSTextAlignmentLeft | |
from fontTools.ufoLib.pointPen import AbstractPointPen | |
from mojo.extensions import setExtensionDefault, getExtensionDefault, registerExtensionDefaults | |
import math | |
import re |
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 : Mr Rogers | |
# shortCut : command+shift+k | |
import merz | |
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber, registerSubscriberEvent, getRegisteredSubscriberEvents, listRegisteredSubscribers, unregisterGlyphEditorSubscriber | |
from mojo.UI import SetCurrentGlyphByName | |
from fontTools.pens.basePen import BasePen | |
from importlib import reload | |
import MrRogersData |
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 : Toggle layer visbility! | |
# shortCut : command+l | |
from mojo.roboFont import AllFonts | |
def showHideOption(displayOptionKey, currentDisplayOptionValue): | |
for layerName in f.layerOrder: | |
if not layerName == 'foreground': | |
f.getLayer(layerName).setDisplayOption(displayOptionKey, not currentDisplayOptionValue) |
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.roboFont import RGlyph | |
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber | |
from mojo.UI import getDefault, setDefault | |
from lib.tools.notifications import PostNotification | |
from fontTools.pens.basePen import BasePen | |
class MyCopyDecomposingPen(BasePen): | |
def __init__(self, glyphSet, outPen): | |
super(MyCopyDecomposingPen, self).__init__(glyphSet) |
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.subscriber import Subscriber, registerGlyphEditorSubscriber | |
''' | |
A startup script to help keep anchors in-sync across glyphs | |
The script will not append anchors, only move existing anchors | |
To set a linked glyph, add 'LinkedGlyphs' in your main glyph's .note | |
Under that line add a comma separated list of glyph names (no spaces) | |
e.g. |