Skip to content

🎥 Make videos programmatically with React

add: test in Fonts composition

benya72152dc4a8cef
diff --git a/packages/example/package.json b/packages/example/package.json
index 5a137ee02a..fbcdc4e859 100644
--- a/packages/example/package.json
+++ b/packages/example/package.json
@@ -34,6 +34,7 @@
"@remotion/cloudrun": "workspace:*",
"@remotion/eslint-config": "workspace:*",
"@remotion/eslint-plugin": "workspace:*",
+ "@remotion/fonts": "workspace:*",
"@remotion/gif": "workspace:*",
"@remotion/google-fonts": "workspace:*",
"@remotion/lambda": "workspace:*",
diff --git a/packages/example/src/Fonts/index.tsx b/packages/example/src/Fonts/index.tsx
index 645fdae6d6..da65104c25 100644
--- a/packages/example/src/Fonts/index.tsx
+++ b/packages/example/src/Fonts/index.tsx
@@ -1,13 +1,21 @@
import React from 'react';
import {AbsoluteFill} from 'remotion';
+import {loadFont} from '@remotion/fonts';
+
+loadFont({
+ family: 'Bangers',
+ url: 'bangers.woff2',
+ weight: '500'
+}).then(() => console.log("Font loaded!"))
export const FontDemo: React.FC = () => {
return (
<AbsoluteFill
style={{
+ fontFamily: 'Bangers',
justifyContent: 'center',
alignItems: 'center',
- fontSize: 200,
+ fontSize: 100,
backgroundColor: 'whitesmoke',
}}
>