Closed brandoncc closed 4 years ago
The NotoColorEmoji font cannot be used because the font outlines are not stored in the standard TrueType glyph font table but in a separate, special font table that supports colors. And this special table is not supported by ttfunk.
In short: It is not possible to use a font with colored glyphs with ttfunk.
Thanks @gettalong. I guess that must be why I keep seeing recommendations of using Japanese fonts (which I am also doing, but many emojis are not supported).
I'm still struggling with this. is there any chance there will eventually be support?
Thanks!
The reason why this is not that easy to support are manyfold. For example,
So your best bet would be to do the Emoji parsing yourself, output the text before, output the emoji (taken from a list of images extracted from the font), output the text after.
You might want to look at asciidoctor-pdf which has implemented support for inline images. Generally, that codebase extends Prawn in many ways and is a good resource to find solutions to common text layout problems. It is rather huge, though.
Thank you for that excellent information @gettalong. I suspect that https://github.com/hidakatsuya/prawn-emoji probably implements a solution like you are describing. Unfortunately, it is unusable because of this issue.
I'm actually blown away that nobody has solved this yet. It is safe to say that I currently don't have nearly the knowledge needed to solve it myself.
Thanks again for entertaining my question!
I'm trying to get emoji rendering working, and I'm failing. I'm trying to use NotoColorEmoji.ttf and I am experiencing this error:
Here is my list of fallback fonts:
All of the other fonts work, but many of the emojis just render as boxes.
Any points on either another way, or getting this font to work, would be appreciated. Thanks!