googlefonts / nanoemoji

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

glyf_colr_1 glyphs contain no outlines #461

Closed sakiodre closed 1 year ago

sakiodre commented 1 year ago

When building with color_format=glyf_color_1 the glyphs contain no outlines, using fonttools to dump the font shows that:

font = TTFont("build/test.ttf")
font.saveXML("test.xml")
<TTGlyph name="u1F19A"/><!-- contains no outline data -->

This becomes a problem when loading the font with FreeType which uses the outlines to calculate the width and height of the glyph, there is a lot of FreeType code which I prefer not to include here but basically, it defaults to 0 for width and height, making the glyph invisible.

Is there anything I can do about this?

Might be related to: fonttools#949

sakiodre commented 1 year ago

Nevermind, it's a freetype problem, see https://gitlab.freedesktop.org/freetype/freetype/-/issues/1229

Although it claims "The 'COLR' v1 API is now considered as stable", but it

doesn't handle glyphs in 'COLR' v1 format by itself; you have to extract the outlines and render them manually.

and provides no way to actually "render them manually".