resvg-js
resvg-js copied to clipboard
Feature request: emoji support
Thanks for this amazing lib!
Unfortunately, it doesn't seem to be able to render emojis in text 😢
See this very simple SVG:
<svg xmlns='http://www.w3.org/2000/svg'
viewBox='0 0 100 100'>
<text y='.9em' font-size='90'>👨💻</text>
</svg>
It doesn't render anything visible.
When trying the playground https://resvg-js.vercel.app/ it doesn't render anything either.
I tried forcing a color emoji font:
{
font: {
fontFiles: ['/Users/xyz/Noto_Color_Emoji/NotoColorEmoji-Regular.ttf'],
loadSystemFonts: false, // It will be faster to disable loading system fonts.
defaultFontFamily: 'Noto Color Emoji',
},
}
But it doesn't help.
Would it be feasible to add this? Thanks.
Have you found any alternatives to display emojis?
I will be investigating this feature.
maybe there are copyright issues?
@qianshancun good point. The emojis would have to come from a font, in which case it would be up to the user to provide a color emoji font they have a license for.
We could rename this issue "support CBDT/CBLC color font format" but I don't want to presume the best way to add this feature, I trust @yisibl ❤️
resvg does not currently support emoji (aka color fonts), please follow: https://github.com/RazrFalcon/resvg/issues/487
maybe there are copyright issues?
Copyright depends on the specific font, beyond the scope of this issue hair.
Thanks @yisibl for following up!