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 fontParts.base.errors import FontPartsError | |
from fontPens.digestPointPen import DigestPointStructurePen | |
def isStrictCompatible(path1,path2): | |
# check interpolation compatibility | |
if type(path1).__name__.split(".")[-1] == "RSegment": | |
if path1.type == path2.type: |
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 vanilla import FloatingWindow | |
from mojo.events import addObserver, extractNSEvent | |
class WASDTool: | |
def __init__(self): | |
addObserver(self, "keyWasPressed", "keyDown") | |
def keyWasPressed(self, info): | |
glyph = info["glyph"] |
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, setDefault, inDarkMode | |
from lib.tools.notifications import PostNotification | |
from fontTools.pens.basePen import BasePen | |
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber, listRegisteredSubscribers | |
class MyCopyDecomposingPen(BasePen): | |
def __init__(self, glyphSet, outPen): | |
super(MyCopyDecomposingPen, self).__init__(glyphSet) |
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 vanilla import * | |
import merz | |
import mojo.subscriber as subs | |
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber | |
from mojo.subscriber import registerSubscriberEvent, getRegisteredSubscriberEvents | |
from mojo.extensions import registerExtensionDefaults, setExtensionDefault, getExtensionDefault, removeExtensionDefault | |
from mojo.drawingTools import * | |
from mojo.UI import SetCurrentGlyphByName | |
from math import radians, tan, pi | |
from AppKit import NSColor |
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.events import addObserver, removeObserver | |
class syncLayerWidths: | |
def __init__(self): | |
self.font = None | |
self.glyph = None | |
addObserver(self, "glyphChanged", "currentGlyphChanged") |
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 NSFilenamesPboardType, NSDragOperationCopy, NSEvent | |
from mojo.events import BaseEventObserver | |
from mojo.UI import GetFile,PostBannerNotification | |
import os | |
from fontTools.ttLib import TTFont | |
import vanilla | |
from fontParts.world import RGlyph | |
try: | |
from AppKit import NSRadioButtonType |
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 sys | |
from fontTools.ttLib import TTFont | |
''' | |
usage: | |
$ python listGSUBFeatures.py path/to/font.otf | |
''' | |
def main(): | |
if len(sys.argv) < 2: |
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 NSFilenamesPboardType, NSDragOperationCopy | |
from mojo.events import BaseEventObserver | |
import os | |
import vanilla | |
from fontParts.world import RGlyph | |
from fontTools.ttLib import TTFont | |
from fontTools.subset.cff import * | |
from fontTools.ttLib.tables._g_l_y_f import Glyph | |
from fontTools.pens.ttGlyphPen import TTGlyphPen | |
import difflib |
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 git | |
import os | |
from mojo.UI import OutputWindow | |
OutputWindow().clear() | |
fontDirs = list(set([os.path.dirname(f.path) for f in AllFonts()])) | |
for dirs in fontDirs: | |
if ".git" in os.listdir(dirs): | |
r = git.Repo(dirs) | |
print("pulling git status for...") |
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 | |
''' | |
A start up script to simply access a glyph's script or unicode category | |
for g in CurrentFont(): | print(CurrentGlyph().getScript()) | print(CurrentGlyph().getCat(verbose=True)) | |
print(g.getScript()) | | | |
| | | |
| | | |
>> Latin | >> Cyrillic | >> Ll : Letter (lowercase) |