sharp
sharp copied to clipboard
Color emoji not rendered
Are you using the latest version? Is the version currently in use as reported by npm ls sharp
the same as the latest version as reported by npm view sharp dist-tags.latest
?
What are the steps to reproduce? i tried this code to convert svg to text
<svg height="117" width="512">
<rect x="0" y="0" width="512" height="117" stroke-width="3px" stroke="white" fill="black" rx="30"/>
<text x="50%" y="50%" fill="white" font-size="5em" baseline-shift="-25%" lengthAdjust="spacing" textLength="90%" text-anchor="middle">😂</text>
</svg>
i tested it on w3schools.com it shows this
but using sharp i got this
and i installed noto-color-emoji
Hi, this is probably due to an issue with rendering coloured fonts, most likely in cairo as there are a few possible candidates here - https://gitlab.freedesktop.org/cairo/cairo/-/issues?scope=all&utf8=%E2%9C%93&state=opened&search=emoji
Will this issue ever get fixed 🤔 the upstream issue has been open from 2 years now 🤷♂️
This is likely to be due to https://gitlab.freedesktop.org/cairo/cairo/-/issues/326
I'm having the same issue and I haven't been able to solve it. I would like to use Twitter Color Emoji rather than noto though. Creating a font.conf with hinting enabled did nothing, and FC_DEBUG=1024 does say the file is being loaded. FC_DEBUG=1 shows a bunch of fonts from the
Any solution to this @lovell ? I'm trying with Apple Color Emoji
I am getting the same issue on sharp. I have tested with noto-color-emoji and with emoji-one on ubuntu 22, but without success.
I have already tried
This is likely to be due to https://gitlab.freedesktop.org/cairo/cairo/-/issues/326
Same issue, in my case pango-view
does render color emoji but sharp
does not. Have spent multiple hours playing with fontconfig configs and debug vars, as well as different fonts.
The fact that I can get pango-view
to render what I want perfectly but not sharp
seems to suggest there's a possible bug in the way sharp
or perhaps libvips
is using pango
, right? I don't understand how these components connect well enough to figure out how it's possible that only sharp
isn't working...
Edit:
This command works: pango-view --backend=cairo --font=sans-serif -q -o test.png test.txt
But this code doesn't:
sharp({ text: { text: "...", font: "sans-serif", rgba: true } });
The emoji is rendered correctly with pango-view
and uses the right font, but is not rendered at all with sharp.