Threshold Pen for Glyphs - Project Request
Stuart Sandler
Posts: 363
I've been using the Threshold Pen script (http://robofab.com/howto/usepens.html) from Robofab for many years happily via FontLab but my workflow has changed to Glyphs and I'd like to use the exact same script in Glyphs.
While I'm aware of similar tools for Glyphs, I'd like to hire somebody to port this expressly to Glyphs so I can run it on the entire font rather just individual characters.
I'm also happy to OpenSource it for the community since it's a great script and if there is interest by the developer and the community. Feel free to message me directly or reply to this thread.
While I'm aware of similar tools for Glyphs, I'd like to hire somebody to port this expressly to Glyphs so I can run it on the entire font rather just individual characters.
I'm also happy to OpenSource it for the community since it's a great script and if there is interest by the developer and the community. Feel free to message me directly or reply to this thread.
1
Comments
-
We might try that. How urgent is it?0
-
Theoretically, RoboFab-based scripts should work as-is in Glyphs. Theoretically, because I just tried ThresholdPen and it failed ... (after I got it running, it only leaves empty glyphs in the font)1
-
And there is the "Delete Short Segments" filter: https://github.com/mekkablue/DeleteShortSegments
0 -
And I fixed the `ThresholdPen`, at least the sample code from the robofab website works now.
0 -
I apologize if this is too off-topic (I can certainly start a new thread), but speaking of RoboFab, does anyone here use the next generation of that code, called "fontParts"?0
-
Many thanks All!
@Georg Seifert - Yes I tried the Delete Short Segments script with Rainer but found it worked very differently and had a different result.
That said, if I launch the Macro panel and paste the script in, it's not running but I'm not sure where to download the updated 'fix' from that does get it running. FWIW, Robofab is not currently installed on this machine, so I'm not sure what assets I need to install in order to run the entire script.0 -
The fix will come with the next update of Glyphs.1
-
Isn't there a convencecon installer in the glypglyph preferences window?0
-
@Georg Seifert I just installed the 1141 update but was still unable to run the script. Kindly advise what I need to do in order to get it running, attached is the error.
0 -
Do you have the latest version of robofab?
0 -
@Georg Seifert To be clear, I don't have Robofab installed on this computer because I wasn't sure what I needed to install.
The latest install instructions I found were from 2013 for OS X 10.7 and located here:
Since I'm on 10.12 and it seems Robofab has been replaced with FontParts, it's unclear to me what should be installed. http://robofont.com/documentation/building-tools/toolkit/robofab-fontparts/
Any suggestions are welcome and I'm sure your answers to me will help other folks in the future who find this thread.0 -
You can try the "Install Modules" in Preference > Addons > Modules or do it manually like this: https://forum.glyphsapp.com/t/manually-installing-vanilla-module/8807 (the explanation is for vanilla but it works the same for robofab, too).
0 -
Thank you @Georg Seifert we're definitely getting close but I received the following errors, not sure what to do to fix them. Kindly advise as you're able and thank you for your ongoing assistance, I know this will help others.0
-
You also need to install the FontTools Python module. RoboFab depends on it.0
-
Thank you @Jens Kutilek that helped reduce the error reporting however it's not fully working yet. Kindly advise what else may be missing as you're able.0
-
Hm, I get a different error:
Traceback (most recent call last): File "<string>", line 8, in <module> File "/Library/Python/2.7/site-packages/robofab/pens/filterPen.py", line 126, in thresholdGlyph aGlyph.drawPoints(wrappedPen) File "/Library/Python/2.7/site-packages/robofab/objects/objectsBase.py", line 1507, in drawPoints c.drawPoints(pen) File "GlyphsApp/GlyphsApp/__init__.py", line 6796, in __GSPath__drawPoints__ File "/Library/Python/2.7/site-packages/robofab/pens/pointPen.py", line 114, in endPath self._flushContour(segments) File "/Library/Python/2.7/site-packages/robofab/pens/adapterPens.py", line 104, in _flushContour assert 0, "illegal segmentType: %s" % segmentType AssertionError: illegal segmentType: offcurve
Which build version of Glyphs are you using? Mine is 1146.0 -
11410
-
You may need the latest GSPen and objectsGS. See https://forum.glyphsapp.com/t/robofab-getpen/2018/120
-
As far as I know, GSPen and objectsGS have been integrated into GlyphsApp some months ago and don't need to be installed separately.
That said, if you have installed them in your scripts folder, maybe remove them so outdated versions are not used accidentally.
I got the thresholdGlyph script to work now by changing some Glyphs Python API stuff. I submitted that to Georg and it will probably part of the next cutting edge build. Until then you could try this code:<p>from robofab.world import CurrentGlyph from robofab.pens.filterPen import thresholdGlyph GSOFFCURVE = "offcurve" GSLayer.drawPoints = DrawPointsWithPen def __GSPath__drawPoints__(self, pen): '''draw the object with a fontTools pen''' pen.beginPath() for i in range(len(self)): Node = self.nodeAtIndex_(i-1) node_type = Node.type if Node.type == GSOFFCURVE: node_type = None pen.addPoint(Node.position, segmentType=node_type, smooth=Node.smooth, name=Node.name) pen.endPath() GSPath.drawPoints = __GSPath__drawPoints__ thresholdGlyph(CurrentGlyph(), 20)<br></p>
0 -
Thanks @Simon Cozens and @Jens Kutilek . . .
I may have to wait until the next cutting edge build, but here's the error I'm now seeing regardless if I install the GSPen or objectGS scripts.Traceback (most recent call last):File "<string>", line 6, in <module>NameError: name 'DrawPointsWithPen' is not defined0 -
The thresholdGlyph example from the roboFab page should work fine as is in Glyphs version 1145.
Maybe we should move this discussion to the Glyphs forum or the GlyphsSDK repository.
0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 803 Font Technology
- 1K Technique and Theory
- 622 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 485 Typography
- 303 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 270 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports