Colored mask

Hi, is there any way to show the mask with a fill (gray).
That would be extremely useful for my current project.

Also, executing the following macro leads to an immidiate crash:

Font = Glyphs.font
for glyph in Font.glyphs:
print glyph.layers[0].background

I just wrote a small plugin: https://dl.dropbox.com/u/3563666/FillBackgroundPathTool.glyphsReporter.zip

Double click it and then active it in the View menu (“Show Filled Background”) and disable “Show background”.

The script works for me. But I changed a lot in the scripting bridge in last week. Maybe I fixed it.

Thanks a lot for this!
It’s great that you can do something like this so easily with the GlyphsReporter protocol.

If you have a look inside the plugin bundle > Contents/Resources/FillBackgroundPathTool.py There is the method
def drawBackgroundForLayer_(self, Layer):
There are only a few lines that do the trick.

I noticed something weird:

If I have the plugin enabled & then run a script like this:
https://gist.github.com/2978968

The plugin stops drawing the background & the following error is thrown:
‘GSBackgroundLayer’ object is not callable (@L30: Path = Layer.background().bezierPath())

If I run the script while having the glyph open, the whole app becomes unresponsive and needs to be force quit.

Or what do you think would be the best way to switch fore- and background?

Please update the script and remove the brackets after “background”.

So line 30 should read: Path = Layer.background.bezierPath()

I added the background as a regular property to the python bridge.

If you need to change the fairground and the background, I usually copy the foreground, active the background and select everything and hit cmd+K, delete everything and paste the foreground: cmd+A > cmd+C > cmd+B > cmd+A > cmd + K > del > cmd+V. This looks much longer as it takes to do it :wink: