Skip to content

Instantly share code, notes, and snippets.

Rainer Erich Scheichelbauer mekkablue

Block or report user

Report or block mekkablue

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mekkablue /
Created Sep 12, 2019
Glyphs: merge paths from other master layers into current master (for selected glyphs)
m = Font.selectedFontMaster
for sl in Font.selectedLayers:
g = sl.parent
print "Processing %s:" %,
targetLayer = g.layers[]
pathcount = 0
for l in g.layers:
if l.isMasterLayer and l != targetLayer:
for p in l.paths:
View Report Area in Square
#MenuTitle: Report Area in Square Units
# -*- coding: utf-8 -*-
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
View Compare Font
#MenuTitle: Compare Font Spacings
# -*- coding: utf-8 -*-
Compare spacing of open fonts, output in the Macro Window.
abc = "abcdefghijklmnopqrstuvwxyz"
frequencies = { # Source: Wikipedia
View Steal
#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")
View Extract kern strings 1st
#MenuTitle: Extract kern strings (1st character)
# -*- coding: utf-8 -*-
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
View Paste in View
#MenuTitle: Paste in View Center
# -*- coding: utf-8 -*-
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()
View SVN
#MenuTitle: SVN Update
# -*- coding: utf-8 -*-
Issues an SVN Update command on specified folders and reports to the Macro Window.
import vanilla, subprocess
class SVNUpdate( object ):
def __init__( self ):
mekkablue / Save as
Created Jul 27, 2019
Save Glyphs as PNGs
View Save as
#MenuTitle: Save Selected Glyphs as PNG
# -*- coding: utf-8 -*-
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):
View Fix Stuck Macro
#MenuTitle: Fix Stuck Macro Window
# -*- coding: utf-8 -*-
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 )
mekkablue / Insert #exit and #entry at
Created Jul 27, 2019
Insert #exit and #entry at Baseline
View Insert #exit and #entry at
#MenuTitle: Insert #exit and #entry at Baseline
# -*- coding: utf-8 -*-
Adds #exit and #entry anchors at the sidebearings on the baseline. Useful for glyphs like period that are reused in glyphs like ellipsis.
def process( thisLayer ):
for thisAnchorInfo in (("#entry",0),("#exit",1),):
newAnchor = GSAnchor() = thisAnchorInfo[0]
You can’t perform that action at this time.