google noto serif TC font family

This commit is contained in:
2023-03-23 18:17:40 +08:00
parent e62d7258f6
commit 972e40f3ab
3 changed files with 14 additions and 2 deletions

View File

@@ -7,6 +7,8 @@ import {
interpolate,
} from 'remotion';
import {loadFont} from '@remotion/google-fonts/NotoSerifTC';
type Props = {
text: string;
fontSize?: number;
@@ -26,6 +28,7 @@ const VerticalText: React.FC<Props> = ({
y,
disappear,
}) => {
const {fontFamily} = loadFont('normal', {weights: ['400']});
const current = useCurrentFrame();
const textArray = Array.from(text);
const currentEndIndex = interpolate(
@@ -52,6 +55,7 @@ const VerticalText: React.FC<Props> = ({
from={from}
durationInFrames={disappear ? disappear - from : 4096}
style={{
fontFamily,
top: `${1080 - y}px`,
left: x,
width: 'min-content',
@@ -63,7 +67,7 @@ const VerticalText: React.FC<Props> = ({
overflow: 'hidden',
}}
>
{textArray.slice(0, currentEndIndex).map((char, index) => (
{textArray.slice(0, currentEndIndex).map((char) => (
<div
style={{
width: 'min-content',