mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
fix: correct Google Fonts API URL construction for proper weight fetching
This commit is contained in:
@@ -15,7 +15,7 @@ async function loadGoogleFont(
|
||||
).text();
|
||||
|
||||
const resource = css.match(
|
||||
/src: url\((.+)\) format\('(opentype|truetype)'\)/
|
||||
/src: url\((.+?)\) format\('(opentype|truetype)'\)/
|
||||
);
|
||||
|
||||
if (!resource) throw new Error("Failed to download dynamic font");
|
||||
@@ -26,8 +26,7 @@ async function loadGoogleFont(
|
||||
throw new Error("Failed to download dynamic font. Status: " + res.status);
|
||||
}
|
||||
|
||||
const fonts: ArrayBuffer = await res.arrayBuffer();
|
||||
return fonts;
|
||||
return res.arrayBuffer();
|
||||
}
|
||||
|
||||
async function loadGoogleFonts(
|
||||
@@ -44,7 +43,7 @@ async function loadGoogleFonts(
|
||||
},
|
||||
{
|
||||
name: "IBM Plex Mono",
|
||||
font: "IBM+Plex+Mono:wght@700",
|
||||
font: "IBM+Plex+Mono",
|
||||
weight: 700,
|
||||
style: "bold",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user