Skip to content

Failed to download dynamic font. Status: 400 #371

Answered by yclgkd
JasonGrass asked this question in Q&A
Discussion options

You must be logged in to vote

I found where the problem lies. The text parameter of loadGoogleFont cannot contain non-English characters.

async function loadGoogleFont(
  font: string,
  text: string
)

The same problem, finally I chose a font that supports non-English characters, the problem is solved.

const fontsConfig = [
    {
      name: "Noto Sans SC",
      font: "Noto+Sans+SC",
      weight: 400 as FontWeight,
      style: "normal" as FontStyle,
    },
    {
      name: "Noto Sans SC",
      font: "Noto+Sans+SC:wght@700",
      weight: 700 as FontWeight,
      style: "normal" as FontStyle,
    },
  ];

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by satnaing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #349 on September 08, 2024 05:42.