Is it possible to predicate based on glyph color?

I use a glyph color to tag precomposed letters such as üäö in latin, cyrillic and greek for use in smart filters. Is there any way to use the predicate command in custom language files in the same way as smart filters to restrict a language category to these letters or to exclude them from one?

Would it also be possible to use predictate to restrict to a certain unicode area? I would like to have a different predicate category that shows all pua glyphs that fulfil certain conditions.

The predicates should support the same keys as the normal smart filters. You can check the “CustomFilter.plist” file in “Application Support/Glyphs 3”.

1 Like

Colors are represented as numbers on the predicate code. For example, red is 0. All color numbers are listed in the Handbook in the section 7.3.5, Color Labels, page 83.

See here:

1 Like

Hmmm…

I added this code here to my Groups-Custom.plist file and now Glyphs crashes on startup.

				{
					name = "PUA";
					predicate = "script == \"cyrillic\" AND unicodeChar >= 57344 AND unicodeChar <= 61439 AND category == \"Letter\"";
				},

Removing this code from the file and saving causes Glyphs to work fine again.

Can you build a smart filter like this with the UI?

Yes, though I copied the Unicodechar code directly from the filter file. I’ll test some more and see if I can get it ti work.

Changing the code to this seems to have made it work. Thanks for all the help.

				{
					name = "PUA";
					predicate = "script == \"cyrillic\" AND unicodeChar >= 57344 AND unicodeChar <= 61439 AND category == \"Letter\"";
				},
1 Like