Inner contours in Color layers

I’m not sure of this is a bug, but if I set fill color in Color layers, the inner contours are also filled.

1 Like

The exported SVG glyph is also one filled path for the outer outline.

Select both paths and apply the same fill to both.

1 Like

I see, thanks. But if I also added gradients I now get four control knobs instead of two and I’m not sure how I’m supposed to move them to get the effects I want, as there seem to be an interdependency between their positions and I can’t make any sense of the effects of moving them around.

the knobs of the gradients are a bit confines and need improvements. Normally the knobs from the biggest contour work for both. When the shapes are not connected any more, select the bigger shape and pick 'Copy Attributes’, and paste it onto the smaller.

After a bit of trial an error, I now add the gradient to the bigger shape first, copy the attributes, then select both shapes and past to them.

I have another related question. I’m trying to get glyphsLib/ufo2ft to build COLRv1 table from these layers. Since a single Color layer in Glyphs can contain multiple gradients, I will have to decompose such layers, but I need to keep the two contours from my original issue in one layer.

If I look into the SVG exported by Glyphs, it merges these two contours into one path with one gradient applied to it, so I’m wondering what algorithm it uses to decide if two paths should be merged into one so that I remain close to one glyphs UI shows, just that they have the exact same gradient attribute, anything else?

Glyphs iterates all shapes and collects all that have the same attributes into one bucket.

I figured as much, thanks for confirming.

Another question, how is the radius of the radial gradients calculated? I thought it would be the distance between start and end points, but it seems to not be the case.

This is handled by AppKit: Apple Developer Documentation

1 Like

Thanks, I found the GNUStep implementation and got the general idea of how it works.

And this: Advanced Drawing Techniques

2 Likes