satori icon indicating copy to clipboard operation
satori copied to clipboard

Failed to load dynamic font for ₹ . Error: [Error: Failed to load font]

Open captainjackrana opened this issue 1 year ago • 6 comments

Verify canary release

  • [X] I verified that the issue exists in the latest Next.js canary release

Provide environment information

Node.js v18.15.0

    Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64
    Binaries:
      Node: 18.15.0
      npm: N/A
      Yarn: N/A
      pnpm: 8.5.1
    Relevant packages:
      next: 13.2.4
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0

Which example does this report relate to?

vercel-og-nextjs

What browser are you using? (if relevant)

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

Some special characters like symbol are not loading in the dynamic title example shown.

Running it locally shows the following error

Failed to load dynamic font for ₹ . Error: [Error: Failed to load font] Screenshot 2023-05-24 at 7 09 11 PM

Expected Behavior

The image should render the special character properly along with others

To Reproduce

  1. Run the vercel-og-nextjs example with pnpm i pnpm dev

  2. Hit the param example url with the title query parameter containing the rupee symbol http://localhost:3000/api/param?title=Rupee%20%E2%82%B9

captainjackrana avatar May 24 '23 13:05 captainjackrana

@captainjackrana It seems like that it render correctly in satori playground

Jackie1210 avatar Jun 05 '23 14:06 Jackie1210

@Jackie1210 did you try running it locally to reproduce the problem?

captainjackrana avatar Jun 07 '23 13:06 captainjackrana

@Jackie1210 did you try running it locally to reproduce the problem?

nope,I didn't find a explicit link to reproduce it according your issue

Jackie1210 avatar Jun 07 '23 14:06 Jackie1210

Verified on playground. This character doesn't work ❀

playground

BryanAM avatar Dec 22 '23 21:12 BryanAM

This seems to be working now in the playground!

mcnaveen avatar Apr 08 '24 08:04 mcnaveen

I had a similar issue and fixed it. Make sure you're not displaying zero-width characters, commonly found in preview deployments with stega encoded data from a CMS like Sanity.

In my situation, I had the bug only on preview deployments, because Sanity's "stega" option was enabled on preview deployments by default. Stega adds zero-width encoded characters for draft mode and since I was rendering a blog post's title in my image, the font would fail to load it.

maxijonson avatar Jun 23 '24 04:06 maxijonson