resvg-js icon indicating copy to clipboard operation
resvg-js copied to clipboard

Feature request: emoji support

Open Offirmo opened this issue 1 year ago • 12 comments

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.

Offirmo avatar Mar 17 '24 16:03 Offirmo

Have you found any alternatives to display emojis?

hoaxvorp avatar Mar 22 '24 13:03 hoaxvorp

I will be investigating this feature.

yisibl avatar Mar 24 '24 17:03 yisibl

maybe there are copyright issues?

qianshancun avatar Mar 25 '24 14:03 qianshancun

@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 ❤️

Offirmo avatar Mar 26 '24 04:03 Offirmo

resvg does not currently support emoji (aka color fonts), please follow: https://github.com/RazrFalcon/resvg/issues/487

yisibl avatar Apr 12 '24 03:04 yisibl

maybe there are copyright issues?

Copyright depends on the specific font, beyond the scope of this issue hair.

yisibl avatar Apr 12 '24 03:04 yisibl

Thanks @yisibl for following up!

Offirmo avatar Apr 12 '24 04:04 Offirmo