thx / resvg-js

A high-performance SVG renderer and toolkit, powered by Rust based resvg and napi-rs.
https://resvg-js.vercel.app/
Mozilla Public License 2.0
1.58k stars 59 forks source link

Feature request: emoji support #316

Open Offirmo opened 8 months ago

Offirmo commented 8 months ago

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.

hoaxvorp commented 8 months ago

Have you found any alternatives to display emojis?

yisibl commented 8 months ago

I will be investigating this feature.

qianshancun commented 8 months ago

maybe there are copyright issues?

Offirmo commented 8 months ago

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

yisibl commented 7 months ago

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

yisibl commented 7 months ago

maybe there are copyright issues?

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

Offirmo commented 7 months ago

Thanks @yisibl for following up!

are commented 6 months ago

It seems that resvg merged https://github.com/RazrFalcon/resvg/issues/487 - are there any additional blockers of bringing it into resvg-js?

yisibl commented 6 months ago

It seems that resvg merged RazrFalcon/resvg#487 - are there any additional blockers of bringing it into resvg-js?

This requires us to upgrade our resvg dependencies to the latest version. I don't have the time at the moment.

Offirmo commented 6 months ago

@yisibl it's completely ok, take your time! Thanks for this open source project!

Offirmo commented 5 months ago

@yisibl 🥺 🐩 pretty please 🙏

facuparedes-litebox commented 2 months ago

no updates yet? 😞