Skip to content

🎥 Make videos programmatically with React

`@remotion/google-fonts`: Fix ignoreTooManyRequestsWarning option (#6918)

ytakahashide13524bf4be
diff --git a/packages/google-fonts/src/base.ts b/packages/google-fonts/src/base.ts
index 719ed730cf..8c0615a35f 100644
--- a/packages/google-fonts/src/base.ts
+++ b/packages/google-fonts/src/base.ts
@@ -198,7 +198,7 @@ export const loadFonts = (
}
}
- if (fontsLoaded > 20) {
+ if (fontsLoaded > 20 && !options?.ignoreTooManyRequestsWarning) {
console.warn(
`Made ${fontsLoaded} network requests to load fonts for ${meta.fontFamily}. Consider loading fewer weights and subsets by passing options to loadFont(). Disable this warning by passing "ignoreTooManyRequestsWarning: true" to "options".`,
);