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
| import ezui | |
| from mm4.tools.pairListParser import * | |
| import metricsMachine | |
| from mm4.mmScripting import MetricsMachineScriptingError | |
| class PairListSetter(ezui.WindowController): | |
| def build(self): | |
| content = """ |
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.roboFont import RGlyph | |
| from fontTools.pens.basePen import BasePen | |
| from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber, listRegisteredSubscribers | |
| from fontPens.flattenPen import flattenGlyph | |
| from scipy.spatial import ConvexHull | |
| class MyCopyDecomposingPen(BasePen): | |
| def __init__(self, glyphSet, outPen): | |
| super(MyCopyDecomposingPen, self).__init__(glyphSet) | |
| self._moveTo = outPen.moveTo |
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.extensions import ExtensionBundle as bb | |
| import datetime | |
| import collections | |
| from pprint import pprint | |
| ext = bb.allExtensions() | |
| i = {} | |
| for e in ext: | |
| time = bb(e).infoDictionary.get("timeStamp") | |
| formatted_date = datetime.datetime.utcfromtimestamp(time).strftime('%Y-%m-%d %H:%M:%S') | |
| i[time] = (e,formatted_date) |
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
| import ezui | |
| from merz.tools.drawingTools import NSImageDrawingTools | |
| from mojo.UI import AllFontWindows, CurrentFontWindow, AllWindows, CurrentGlyphWindow | |
| class frontAndCenter(ezui.WindowController): | |
| def build(self, parent, viewType): | |
| self.buttonMap = {} | |
| self.parent = parent |
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 | |
| class LayerSinker(Subscriber): | |
| def fontDocumentDidOpen(self,info): | |
| font = info["font"] | |
| font.lib['com.typemytype.robofont.syncGlyphLayers'] = 'metrics' | |
| registerRoboFontSubscriber(LayerSinker) |
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.roboFont import RGlyph | |
| from mojo.UI import getDefault | |
| ''' | |
| g = CurrentGlyph() | |
| g.markColorName = "Red" | |
| ''' | |
| def _setColorName(self, color=None): | |
| if not isinstance(color, str): |
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 AppKit import NSBeep,NSTimer,NSRunLoop,NSRunLoopCommonModes | |
| import git | |
| import os | |
| from mojo.extensions import setExtensionDefault, getExtensionDefault | |
| import re | |
| from mojo.UI import PostBannerNotification | |
| ''' | |
| A startup script for RoboFont to automatically commit to Git every 5 minutes. | |
| To use, run the following script with your GitHub email: |
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
| ''' | |
| fontParts add-on to get specific locations of a glyph's bounds | |
| 10 | |
| 0 3 6 | |
| ####### | |
| # # | |
| # # | |
| 9 1 ## 4 ## 7 |
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 | |
| import AppKit | |
| class MargielaTabs(Subscriber): | |
| def fontDocumentDidOpen(self,info): | |
| newFont = info["lowLevelEvents"][0]["font"] | |
| windowsMap = {} | |
| allFonts = {f.info.familyName:AllFonts().getFontsByFamilyName(f.info.familyName) for f in AllFonts()} | |
| for familyName,fonts in allFonts.items(): |