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
#MenuTitle: Report Area in Square Units | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
Calculates the area of each selected glyph, and outputs it in square units. Increase precision by changing the value for PRECISION in line 9 (script will slow down). | |
""" | |
PRECISION = 2 # higher numbers = more precision, but slower |
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
#MenuTitle: Compare Font Spacings | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
Compare spacing of open fonts, output in the Macro Window. | |
""" | |
abc = "abcdefghijklmnopqrstuvwxyz" | |
frequencies = { # Source: Wikipedia |
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
#MenuTitle: Steal Colors from Font | |
"""Copy glyph colors from one font to another.""" | |
import vanilla | |
class GroupsCopy(object): | |
"""GUI for copying colors from one font to another""" | |
def __init__(self): | |
self.w = vanilla.FloatingWindow((400, 70), "Steal colors") | |
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
#MenuTitle: Extract kern strings (1st character) | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
Analyze a textfile: look for certain characters and output all letter combinations occurring in the text file to the Macro Window. | |
""" | |
import vanilla | |
from PyObjCTools.AppHelper import callAfter |
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
#MenuTitle: Paste in View Center | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
Pastes components and paths in clipboard into the center of the Edit view. | |
""" | |
import math | |
def transform(shiftX=0.0, shiftY=0.0, rotate=0.0, skew=0.0, scale=1.0): | |
myTransform = NSAffineTransform.transform() |
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
#MenuTitle: SVN Update | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
Issues an SVN Update command on specified folders and reports to the Macro Window. | |
""" | |
import vanilla, subprocess | |
class SVNUpdate( object ): | |
def __init__( self ): |
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
#MenuTitle: Save Selected Glyphs as PNG | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
Saves selected glyphs as PNGs. Uses ascender and descender for top and bottom edges of the images. | |
""" | |
from AppKit import NSCalibratedRGBColorSpace, NSPNGFileType | |
def transform(shiftX=0.0, shiftY=0.0, rotate=0.0, scale=1.0): | |
""" |
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
#MenuTitle: Fix Stuck Macro Window | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
If you cannot resize your Macro window anymore, run this script. | |
""" | |
import os | |
terminalCommand = 'defaults delete com.GeorgSeifert.Glyphs2 "NSWindow Frame MacroPanel"' | |
os.system( terminalCommand ) |
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
#MenuTitle: Select following on-curve point | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
From the currently selected point, go to the next on-curve. | |
""" | |
def getTheFirstPoint(selection): | |
for thisItem in selection: | |
if type(thisItem) == GSNode: | |
return thisItem |
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
#MenuTitle: Make c2sc from smcp | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
Makes component based c2sc glyphs, using the smcp glyphs as components. | |
Ignores selected glyphs without an .smcp ending. | |
""" | |
Font = Glyphs.font |