Robofab Pens in Glyphs

Will the following Robofab script work in Glyphs? I’m trying to talk a fellow font designer into switching to Glyphs, and my Robofab isn’t working on my machine.

from import *
from robofab.pens.filterPen import thresholdGlyph
d = 10
thresholdGlyph(CurrentGlyph(), d)

If it doesn’t work would there be a Glyphs equivalent to this script?

Robofab does work in Glyphs. You have to install the wrapper script from github in particular the

I needed to fix a view things but now the script runs fine.
There might be some more issues, I did not had many testers for it. I’m happy to improve on that.

Not every script that was written for RoboFab in FontLab does work as there where many hacks to get it to work in FontLab and those do not work in Glyphs.

Thank you kindly for the info!


This threshold pen was working for me for the longest time however it isn’t working anymore, I can run it on a single glyph but it doesn’t work globally. Also it removes all counter paths. Is there any changes that could be made to make it run globally for all glyphs in a font file?

#MenuTitle: Threshold 11

from objectsGS import *
from import CurrentFont
from robofab.pens.filterPen import thresholdGlyph

d = 11

f = CurrentFont()
selection = f.selection

for glyph in selection:
	print "Filtering", glyph
	g = f[glyph]
	thresholdGlyph( g, d )
print 'All done filtering the selected glyphs!'

What error message do you get?

Filtering A
Traceback (most recent call last):
File “Threshold”, line 16, in
thresholdGlyph( g, d )
File “/Users/dathanboardman/Library/Application Support/Glyphs/Scripts/robofab/pens/”, line 128, in thresholdGlyph
File “/Users/dathanboardman/Library/Application Support/Glyphs/Scripts/robofab/objects/”, line 1525, in appendGlyph
File “/Users/dathanboardman/Library/Application Support/Glyphs/Scripts/robofab/objects/”, line 1508, in drawPoints
File “/Users/dathanboardman/Library/Application Support/Glyphs/Scripts/robofab/objects/”, line 1996, in drawPoints
File “GlyphsApp/”, line 33, in endPath
File “GlyphsApp/”, line 546, in _invalidateContours
AttributeError: ‘GSLayer’ object has no attribute ‘updatePath’

I fixed it.

1 Like

I just tried rerunning the script but got the same error message. Or do you mean you fixed the script?

I believe, in this case, the fix is in Glyphs and will be included in the next update (it may have already been included in the beta 2.6.1 (1208), released earlier today).

Ah yes, it works, thank you @GeorgSeifert & @composerjk !!!