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.UI import CurrentSpaceCenter | |
| def measureLine(pointSize, records): | |
| scale = pointSize / window.font.info.unitsPerEm | |
| sublists = [] | |
| currentSublist = [] | |
| lineBreakChar = "NewLineGlyph" | |
| for item in records: | |
| if item.glyph.objectName == lineBreakChar: |
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, registerCurrentFontSubscriber | |
| import unicodedata | |
| class AutoNameSetter(Subscriber): | |
| debug = True | |
| def build(self): | |
| pass | |
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, InstanceDescriptor | |
| from ufoProcessor import DesignSpaceProcessor, ufoOperator | |
| import tempfile | |
| import os | |
| import shutil | |
| from mojo.UI import GetFile | |
| f = CurrentFont() | |
| file = f.lib.get("com.connordavenport.interpolateSupport.designspaceFile") | |
| if file: |
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, InstanceDescriptor | |
| from ufoProcessor import DesignSpaceProcessor, ufoOperator | |
| import tempfile | |
| import os | |
| import shutil | |
| dsPath = 'path/to/file.designspace' | |
| for f in AllFonts(): | |
| for l in f.layers: | |
| for g in l: |
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 makeParts(Subscriber): | |
| debug = True | |
| def glyphEditorWantsContextualMenuItems(self, info): | |
| myMenuItems = [ | |
| ("Make Component of Contour(s)", self.markPartCallback), |
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.subscriber import Subscriber, registerRoboFontSubscriber | |
| from mojo.UI import PostBannerNotification, Message | |
| DEFAULTSKEY = "com.connorDavenport.commitedRelationship" | |
| SAVELIMIT = 5 | |
| class commitedRelationship(Subscriber): | |
| def fontDocumentWillSave(self,info): |
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
| g = CurrentGlyph() | |
| f = g.font | |
| of = AllFonts().getFontsByStyleName(f.info.styleName.replace(" Italic", ""))[0] | |
| og = of[g.name] | |
| try: | |
| fr = g.width/og.width | |
| except ZeroDivisionError: | |
| fr = 1 | |
| with g.undo(): | |
| g.clearAnchors() |
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 re | |
| sampleText = ''' | |
| A spectre is haunting [Europe](www.robofont.com) — the spectre of **communism**. All the __powers of old Europe have__ entered into a holy alliance to exorcise this spectre: Pope and Tsar, Metternich and Guizot, French Radicals and German police-spies. | |
| Where is the party in opposition that has not been decried as communistic by its opponents in power? Where is the opposition that has not hurled back the branding reproach of **communism**, against the more advanced opposition parties, as well as against its reactionary adversaries? | |
| Two things result from this fact: | |
| I. **Communism** is *already acknowledged* by all _European_ powers to be itself a power. |
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 |
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 |