Hi, Can I use glyphsLib to call plug-ins or scripts in Glyphs?
You have to explain a bit more what you are trying to do.
I wanted to try if I could import an svg file into a Glyphs file by calling NSClassFromString(“GSSVGtoPath”) in Glyphs via glyphsLib.
This is the code snippet:
import glyphsLib from glyphsLib import GSFont from glyphsLib.parser import Parser from glyphsLib.classes import GSGlyph from glyphsLib.builder import to_designspace from glyphsLib.glyphdata import get_glyph from glyphsLib.writer import Writer from glyphsLib import Glyphs from glyphsLib import GSLayer font = GSFont("02.glyphs") print(font) GSSVGtoPath = NSClassFromString("GSSVGtoPath") pickpath = GetFolder("Please choose a folder") pickextension = "svg" Importer = GSSVGtoPath.alloc().init() Importer.readFile_toLayer_error_(NSURL.fileURLWithPath_(pickpath + '/' + glyph.name + '.' + pickextension), layer, None)
No. that is not possible. Why do you try to do that with glyphsLib and not in Glyphs directly? There are options to run code from outside of Glyphs, but it is a bit tricky.
I was just curious if this was possible, the idea came to me when I needed to import svg files into multiple Glyphs