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
import math | |
import merz | |
from mojo.UI import PostBannerNotification, getDefault, setDefault, UpdateCurrentGlyphView, getGlyphViewDisplaySettings, setGlyphViewDisplaySettings, preferencesChanged, inDarkMode | |
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber, listRegisteredSubscribers | |
from ufoProcessor.emptyPen import DecomposePointPen | |
class CustomMeasureTool(Subscriber): | |
debug = 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
font("Zapata-Light") | |
w,h,b,o,i,q=width(),height(),(0,.05,.1),(.9,.2,0),0,.75 | |
def nfs(wi,wd): | |
fontSize(20) | |
return(wd/textSize(wi)[0])*20 | |
fill(*b) | |
rect(0,0,w,h) | |
for wr in "YOU NEED PYTHON".split(): | |
fill(*o)if wr[0]!="P"else fill(1) | |
fs=nfs(wr,w-40) |
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
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 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 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 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 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 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 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 |
NewerOlder