Color Layers to SVG and decomposing components

When I export a layered font as a SVG Color font using a Color Layers to SVG Custom Parameter, Glyphs will decompose all components, something that it doesn’t do if this CP isn’t present.

Is there a way to stop this? There have been a few times when I’ve exported this way and then saved the file, overwriting the version that contains components when I shouldn’t have and I’ve had to go back and recreate things. Is possible that the behaviour for this could be changed?

Can you send me a file that (still) has some components that would be decomposed when exporting?

Here you go. Exporting with Remove Overlap checked decomposes the components. This doesn’t happen when the CP isn’t present.

Decompose…zip (2.2 KB)

Thanks for the file. I fixed it.

1 Like


I’m having a similar issue. I’m trying to export a svg Pixel Font in Glyphs 3. The “pixels” are all made from a single component, which is a native Color layer containing a rectangle filled with a gradient.

Bildschirmfoto 2021-11-04 um 17.12.30

This is a test glyph made from intact components (all on one Color layer):

Bildschirmfoto 2021-11-04 um 16.53.39

Custom parameters: “Color Layers to SVG”, “Export SVG table” checked.
Export: “Autohinting” and “remove overlap” unchecked.

When I export as .otf and test the font, all components are decomposed and merged to one shape, which is filled with a singular gradient:

Bildschirmfoto 2021-11-04 um 16.54.05

How can I prevent this from happening? Is it possible what I’m trying to achieve?
While working in the Glyphs editor (singular native color layer) I also noticed that sometimes gradient fills expand over multiple shapes when copied. Only the first time a “true” copy of the shape with the intact gradient relative to its shape is made - which then is overwritten with the same “global gradient position” on export.

I noticed building the gradient from scratch again – no copying or components – helps this last issue, but is extremely time consuming.

This issue in various forms has been keeping me busy the last couple of days, which makes me think that I might not understand a fundamental principle of Color Layer/SVG fonts. I always run into issues when placing multiple of the same (native gradient or SVG) elements on one layer.

Greetings :slight_smile:

If two shapes have the same attributes, they are merged into one shape. This mostly fine, except in your case. To hack it, you could ad a small, invisible shape to the pixel glyph.

Can you send me the file? I’ll see if I can fix this.

1 Like

Just sent it over via the messenger!

I tried adding an invisible path to the pixel glyph, unfortunately nothing changed on export