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
for f in AllFonts(): | |
fix = [] | |
fixed = {} | |
todel = [] | |
for name,contents in f.groups.items(): | |
for gs in contents: | |
if gs not in f.keys(): | |
fix.append(name) | |
for n in list(set(fix)): |
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 os | |
from fontTools.ttLib import TTFont | |
''' | |
list of SFNTs | |
''' | |
fontList = [] | |
for path in fontList: |
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 os | |
from fontTools.ttLib import TTFont | |
''' | |
list of SFNTs | |
''' | |
fontList = [] | |
for path in fontList: |
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 getExtensionDefault, setExtensionDefault | |
from mojo.events import addObserver | |
''' | |
Must set this as a start-up script! | |
This observer adds the font path to a list that can be accessed later | |
''' | |
DEFAULTSKEY = "com.connordavenport.CanOpener" |
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 fontTools.misc import bezierTools as bT | |
import math | |
import mojo.drawingTools as d | |
from lib.tools.notifications import PostNotification | |
from mojo.events import addObserver, removeObserver, EditingTool, installTool, BaseEventTool | |
from defconAppKit.windows.baseWindow import BaseWindowController | |
from mojo.UI import PostBannerNotification, getDefault, setDefault, CurrentGlyphWindow, UpdateCurrentGlyphView, getGlyphViewDisplaySettings, setGlyphViewDisplaySettings, preferencesChanged | |
from vanilla import HUDFloatingWindow, Slider, SquareButton,Group | |
from defcon import Contour, Font | |
import AppKit |
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
w = h = 1000 | |
newPage(w,h) | |
fill(0) | |
rect(0,0,w,h) | |
# -------- change these -------- # | |
pixelSize = 7 | |
copy = "Testing" |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> |
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 fontTools.designspaceLib import DesignSpaceDocument | |
dspPath = 'path/to/file.designspace' | |
tempPath = dspPath.replace(".designspace","-reordered.designspace") | |
dsp = DesignSpaceDocument.fromfile(dspPath) | |
instanceMap = {} | |
for instance in dsp.instances: | |
instanceMap[instance] = tuple(instance.designLocation.values()) | |
reordered = sorted(instanceMap.items(), key=lambda x: x[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 git import Repo | |
import os | |
from fontTools.ufoLib.glifLib import readGlyphFromString, GlyphSet | |
import time | |
def getCommits(self,): | |
glif_path = get_glif_path_from_glyph(self) | |
commits = get_all_commit_for_file(glif_path) | |
history = {GlyphCommit(b):GlyphCommit(b).hash for b in commits} | |
return history |
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 : GitMachineMini | |
# shortCut : command+shift+c | |
from AppKit import NSBeep | |
import git | |
import os | |
import ezui | |
from mojo.extensions import setExtensionDefault, getExtensionDefault | |
import webbrowser | |
import re |