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.56k stars 55 forks source link

Feature request: emoji support #316

Open Offirmo opened 7 months ago

Offirmo commented 7 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 7 months ago

Have you found any alternatives to display emojis?

yisibl commented 7 months ago

I will be investigating this feature.

qianshancun commented 7 months ago

maybe there are copyright issues?

Offirmo commented 7 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 6 months ago

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

yisibl commented 6 months ago

maybe there are copyright issues?

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

Offirmo commented 6 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 5 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 5 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 1 month ago

no updates yet? 😞