Skip to content

Commit dc3323b

Browse files
authored
chore: use Google Fonts API v2 to get fonts for ogp (jackyzha0#1705)
1 parent c98ef7e commit dc3323b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

quartz/util/og.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export async function getSatoriFont(headerFontName: string, bodyFontName: string
3535
async function fetchTtf(fontName: string, weight: FontWeight): Promise<ArrayBuffer> {
3636
try {
3737
// Get css file from google fonts
38-
const cssResponse = await fetch(`https://fonts.googleapis.com/css?family=${fontName}:${weight}`)
38+
const cssResponse = await fetch(
39+
`https://fonts.googleapis.com/css2?family=${fontName}:wght@${weight}`,
40+
)
3941
const css = await cssResponse.text()
4042

4143
// Extract .ttf url from css file

0 commit comments

Comments
 (0)