tomolt / libschrift

A lightweight TrueType font rendering library
ISC License
471 stars 32 forks source link

Does libschrift support colored emojis? #18

Closed ghost closed 2 years ago

ghost commented 2 years ago

I have no idea how emojis work....

Do emojis have many glyph for each color? Do emojis have a special glyph which has lots of colors in it?

But in any case, does libschrift has support for colored emojis?

tomolt commented 2 years ago

Sadly, no. I'll update the Limitations section of the Readme to avoid future confusion.

In case you are interested in the technical aspects:

A big part of the problem is that there's no one standard definition for how color emojis should be embedded in fonts.

IIRC, Apple layers multiple single-color glyphs over each other to create multi-color emojis. We could implement that, but AFAIK it is patented, so we won't.

Another solution comes from Microsoft, and is ridiculous. They embed entire SVG XML files within the font file. Parsing & rendering SVGs is a lot more involved than anything libschrift is doing so far.

I believe I read somewhere that there's a third method where fixed-size RGB raster images are embedded into the font file. This might be viable. But even if we implemented this method, it would only work for fonts which have been made this way.

One way or another, for color emoji to work, we would also have to add a fair bit of additional functionality to the API of the library.