googlefonts / nanoemoji

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

How to create CBDT from PNG input files? #447

Open linusg opened 1 year ago

linusg commented 1 year ago

I'm not sure if this is in scope for nanoemoji, poking around in the source code for a bit suggests it might be possible - SVGs are rasterized to PNGs internally, after all, at least for CBDT fonts.

My use case is as follows: I have PNG input files, they're pixel art emojis. I want to package them into a TTF file, which I currently do using nanoemoji by first turning the bitmaps into SVG files (actual paths, not simply embedding PNG data), feeding those to nanoemoji which then runs them through picosvg/resvg and takes care of the rest. This process unfortunately creates visible gaps between path segments:

image

What would be the best way to approach this without temporary SVG files?

The project in question is https://github.com/linusg/serenityos-emoji-font. Thanks in advance!