googlefonts / nanoemoji

A wee tool to build color fonts.
Apache License 2.0
239 stars 19 forks source link

maximum_color requires 'glyf', can't generate CFF-flavored COLR from OT-SVG #444

Open anthrotype opened 1 year ago

anthrotype commented 1 year ago

Issue extracted from https://github.com/googlefonts/nanoemoji/issues/435

[Gilbert Color font] is a CFF-flavored opentype font (.otf) so it does not contain any "glyf" table, only "CFF ", with the outlines of the black-&-white only glyphs. In theory we could/should support creating a CFF-flavored COLR font, and nanoemoji can make one already from a set of .svg files (with --color_format=cff_colr_1 flag). Supporting making these from an OT-SVG font using maximum_color tool is possible, just takes some care with adding the extra glyphs to the existing CFF table (need to refresh my memory on that).

In the meantime, I suggest you do this. Convert your CFF-flavored opentype font to a TrueType-flavored one (.ttf), so it will have "glyf" instead of "CFF ". You can use this otf2ttf.py script in fonttools/Snippets directory.