The tokes tutorial has $[isColorGlyph == true] but if I use it I get an error:
Invalid glyph class predicate “$[isColorGlyph == true]”
The tokes tutorial has $[isColorGlyph == true] but if I use it I get an error:
Invalid glyph class predicate “$[isColorGlyph == true]”
That’s a typo. It should be isAnyColorGlyph which covers any of the color glyph types. There are also more specifically:
isFullColorGlyph (as used for SVG, PDF, and bitmap images)isColorPaletteGlyph (COLR/CPAL)isSVGColorGlyph (contains SVG image file)isAppleColorGlyph (sbix)Thanks. It would be nice to have a complete list of the predicates in the handbook. I’m trying to add a few more to glyphsLib.
You can find a copy of the available symbols in the headers that ship with Glyphs:
Glyphs 3.app/Contents/Frameworks/GlyphsCore.framework/Headers/GSGlyph.h
These just check whether any of the layers returns YES/true for the same symbols.
Glyphs 3.app/Contents/Frameworks/GlyphsCore.framework/Headers/GSLayer.h
Usable from a predicate are methods without parameters:
- (type_name)symbol_name;
and properties:
@property (..., getter=getter_symbol_name) type_name symbol_name;
When there is a getter, use its symbol.
We have renewed API docs in the works, that should be easier to reference.
Thanks. Having this listed somewhere that can be linked to would be helpful when as a documentation. Not everyone using/hacking glyphsLib has access to Glyphs app.
Certainly, I’m working on the docs. Everyone can download Glyphs and inspect the headers, regardless of license or OS.