I want to know wether there is a ‘component’ in a glyph or not.
But I cant build the right method because I dont really know whats the right ‘position’ for calling a component.
f.e.:
I got two glyphs selected. ‘A’ is ‘empty/no-nodes’ and ‘B’ is a full-component. (I want to know the difference for some branch).
Now I got this:
if len(l.components) > 0:
print 'This glyph has components\n’
else:
print ‘glyph is empty\n’
if len(l.paths) > 0:
print ‘This glyph has outlines\n’
I got the following error-message for an ‘empty’ glyph:
Error:
Traceback (most recent call last):
File “”, line 15, in
File “/Users/Oliver/Library/Application Support/Glyphs/Scripts/GlyphsApp.py”, line 22, in len
return len(self.values())
TypeError: object of type ‘NoneType’ has no len()
the very first script of georg seems to work fine:
empty glyph > output : n o t h i n g
outline glyph > output : … has outlines
pure component > output : … has component
outline and comp > output … has outline … hast component
so thank you again.
are there any known ‘structural-changes’ now, for ‘older’ scripts
or was this just a ‘bug’?