vercel / satori

Enlightened library to convert HTML and CSS to SVG
https://og-playground.vercel.app
Mozilla Public License 2.0
11.14k stars 251 forks source link

Unicode font breaks #215

Open mcnaveen opened 2 years ago

mcnaveen commented 2 years ago

Bug report

Description / Observed Behavior

When I tried to use Tamil Font (Unicode) (Example: https://fonts.google.com/specimen/Baloo+Thambi+2) it was not rendering properly. So I tried the same one in /pages/index.js where it's working properly.

What kind of issues did you encounter with Satori?

image

Expected Behavior

image

Reproduction

I created this repo (Main Branch): https://github.com/mcnaveen/bug-vercel-og

Additional Context

Satori version, and any other context about the problem here.

mskian commented 2 years ago

expected Behaviour try using Unicode Tamil Fonts it will work before pulling Unicode encoding and trying it

encodeURIComponent(`எவரும், அடிமையாக வைத்திருக்கப்படுதலோ அல்லது அடிமைப்பட்ட நிலையில்
        வைத்திருக்கப்படுதலோ ஆகாது; அடிமை நிலையும் அடிமை வியாபாரமும் அவற்றில்
        எல்லா வகைகளிலும் தடைசெய்யப்படுதல் வேண்டும்.`);

Make sure that your development environment has Tamil font installed

Linux

sudo apt-get install fonts-indic

I follow this method for HTML Canvas Text

mcnaveen commented 2 years ago

I have already Tamil Fonts installed in my development environment. Using encodeURIComponent returns image like this.

image

mskian commented 2 years ago

Oops just noticed it has a Unicode support issue - Check output

sahithyandev commented 1 year ago

I guess it's an issue with opentype.js

image

mcnaveen commented 1 year ago

@sahithyandev I think so. Seems this is not new!

https://github.com/opentypejs/opentype.js/issues/390

errhythm commented 1 month ago

Is there any update on this? Indic language fonts are still breaking while rendering.

Generated SVG: image

Satori HTML Native: image

OG Playground Test