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
def smartSet(self, pair, value, exceptionType=None): | |
''' | |
pair must be a tuple, its contents can be a glyphName or a group's name | |
value must be an integer, why would you even kern on fractions.... | |
exceptionType is the level of searching the function will do | |
None : use the top level group or glyph names, no exceptions | |
g2G : glyph to Group exception | |
g2g : glyph to glyph exception | |
G2g : Group to glyph exception |
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 metricsMachine as mm | |
# -------------------------------- | |
# functions taken from Kern-a-lytics | |
# -------------------------------- | |
import itertools | |
import collections | |
def high_gamut_dict(cmb_kerning, approx_amount=100): |
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
#!/usr/bin/env python3 | |
import AppKit | |
from mojo.subscriber import Subscriber, WindowController | |
from mojo.UI import getDefault | |
from mojo.events import EditingTool, installTool | |
from mojo.subscriber import registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber | |
from mojo.roboFont import OpenWindow | |
from mojo.tools import IntersectGlyphWithLine |
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): |