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, registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber, listRegisteredSubscribers | |
from mojo.UI import inDarkMode | |
class anchor_scrubber(Subscriber): | |
debug = False | |
def build(self): | |
editor = self.getGlyphEditor() |
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 | |
from mojo.UI import GlyphRecord | |
class space_center_alts_manager(Subscriber): | |
def started(self): | |
self.glyph = None | |
self.alternates = [] | |
self.space_center = None |
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 touche import Touche | |
# uses Ondrej Jób's source data from Context of Diacritics via Setup Type | |
# and Nina Stössinger's Touche to check touching pairs in the current font. | |
# https://www.setuptype.com/x/cod/source/lists | |
real_world_pairs = ''' | |
a aacute | |
a adieresis | |
a agrave |
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 math | |
from mojo.events import postEvent | |
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber, listRegisteredSubscribers | |
from lib.tools.defaults import getDefault | |
from fontTools.misc import transform | |
border = getDefault("glyphViewVerticalPadding") | |
fontsize = getDefault("textFontSize") | |
metricsStroke = getDefault("glyphViewFontMetricsStrokeColor") |
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 | |
def _setExport(self, export): | |
skipExportGlyphs = set(self.font.lib.get("public.skipExportGlyphs", [])) | |
if export == False: | |
skipExportGlyphs.add(self.name) | |
elif export == True: | |
if self.name in skipExportGlyphs: | |
skipExportGlyphs.remove(self.name) | |
else: |
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, unregisterRoboFontSubscriber | |
from mojo.UI import getDefault | |
from AppKit import NSMenuItem | |
from mojo.tools import CallbackWrapper | |
import ezui | |
class set_contextual_mark_colors(Subscriber): | |
debug = True |
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
''' | |
Custom RGlyph `bounds` property that takes anchors into account | |
''' | |
@property | |
def full_bounds(self): | |
bounds = list(self.bounds) | |
for anchor in self.anchors: | |
if anchor.x < bounds[0]: | |
bounds[0] = anchor.x | |
if anchor.x > bounds[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 mojo.subscriber import Subscriber, registerRoboFontSubscriber | |
from vanilla import * | |
import AppKit | |
import os | |
from compositor.textUtilities import convertCase | |
from defconAppKit.windows.baseWindow import BaseWindowController | |
from defconAppKit.controls.openTypeControlsView import OpenTypeControlsView | |
from defconAppKit.controls.glyphSequenceEditText import GlyphSequenceEditText |
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 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 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
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) |
NewerOlder