Color font exports components

I’ve been working on some color fonts, and unlike earlier designs, they will have to usable for others this time. There is currently a bug with the export of color (layer) fonts which will add all your components to the exported file, resulting in an unusable typeface. (with a pretty long glyphs panes.) With the color removed it all works fine, as each component is set to non-exporting, but it seems the color layers override this.

The happens with both methods: When the components have color layers themselves or when they are placed in a color layer in the character itself.

I found this topic which notes this problem. Is this the same bug? (as the post is from some years back.)

Just to confirm: You are exporting as CPAL?

Yes. Also, next to CPAL I’ve used Layers to SVG (for Adobe apps) which gives the same result.

Can you send the .glyphs file?

Sent one of the files, if you need another example, let me know!

Just as a heads up, as I only took a brief note of it: Upon closer inspection it isn’t the components that get exported, but each color layer of each glyph gets a character of it’s own in the font. At first I thought this had to do with the export parameters (which does play a part), but even removing those (and exporting it as a non-color font) leads to a similar result.

My method isn’t great, but it is the only way to keep the export compatible with the Adobe apps, a webfont and future font variations.

1 Like

COLR table layers are separate glyphs (OpenType has no concept of layers, this is a font editors idiom), so there is no way around Glyphs exporting each layer as a separate glyph.

1 Like

Thank you, quite clear! For a webfont this is no problem, but for other apps this is tricky. So the only solution is to rebuild them (in Glyphs) using master with colors? (which export fine without extra glyphs). This will be fun, as the color order varies quite a lot in at least two of the experiments :wink:

I guess this does mean that any future Variable Color Fonts use (unless another standard is implemented) is off the table for desktop apps.

Frankly, I don’t quite understand what the bug is. Why is it a problem that all shapes are exported as separate glyphs?

Even with one character it can quickly get out of hand, making your glyphs palette a mess. The SVG Master-color method does it perfectly however.

And as I said above: For webfonts I have is no problems with this, but for an in-app font, it isn’t really desirable.

That is a limitation of glyph palette, a smarter one would have excluded glyphs that are only accessible from the COLR table, but Adobe apps don’t support COLR table AFAIK so not a big surprise.

SVG table embeds SVG documents in the font, so layers don’t have separate glyphs as this is a built-in concept in SVG, which why you don’t have the glyph palette issue with SVG font.

Your best option, IMO, is to create separate fonts, one with SVG table and one with COLR table.

1 Like

Thank you!

Yeah I expected as much. Keeping the Variable Color versions and SVG versions in sync will be a pain, but no pain no gain I guess.

You can export both versions from the same source. There are several custom parameters to control that.

I am currently using an COLR source to create both the Variable Color Font COLR TTF’s and the Adobe-compatible SVG-OTF’s. But when using the method from how to export to SVG, the export is in black.

So I have been using the Color Layers to SVG parameter, which works perfectly, but leads (as in the screengrab above) to a character for each color layer in each character.

Then you can add a Export COLR Table and uncheck the box in those instances. That will prevent those extra glyphs.

1 Like

Thanks! Seems that out of all combinations I made, this is the solution. But just for info: What is the output of Option B - Choice 2 on the tutorial? As it didn’t output as a color font for me, and I needed an combination of choice 2/3.

It’s a lifesaver though, this works perfectly!

What do you mean by Choice 2 and 2/3. What exactly did you do? And how did you test that font (app and operating system).

Sorry, I meant the options & choices posed in the tutorial I linked to. As not exporting with the SVG layers option ticked (as choice 2) gives a black/white file. (in Catalina font preview, when embedded in a webpage, or when inspected on sites such as Wakamaifondue).

Are you exporting as CPAL then?
Perhaps send me the .glyphs file.