Spaces:
Running
Running
Commit ·
c750888
1
Parent(s): 1851961
Load fonts from CSS
Browse files
src/ig-reel/IGSimpleScene.tsx
CHANGED
|
@@ -18,7 +18,6 @@ import { IGMediaRender } from './IGMediaRender';
|
|
| 18 |
import { Group } from '../models/Types';
|
| 19 |
import { VideoSplash } from '../anims/VideoSplash';
|
| 20 |
import Transitions from '../../public/assets/transitions.json'
|
| 21 |
-
import * as SubtitleFont from "@remotion/google-fonts/Roboto";
|
| 22 |
|
| 23 |
export type DisplayMedia = SectionMedia &
|
| 24 |
{ idx: number, durationFrames: number, startFrame: number, endFrame: number, }
|
|
@@ -37,9 +36,6 @@ export const IGScene: React.FC<any> = (props: {
|
|
| 37 |
const frame = useCurrentFrame();
|
| 38 |
let speechPath = RenderUtils.getFileName(item?.audioFullPath)
|
| 39 |
|
| 40 |
-
let { fontFamily } = SubtitleFont.loadFont("normal", {
|
| 41 |
-
weights: ['900']
|
| 42 |
-
})
|
| 43 |
|
| 44 |
useEffect(() => {
|
| 45 |
const subFile = staticFile(RenderUtils.getFileName(audioCaptionFile))
|
|
@@ -247,7 +243,7 @@ export const IGScene: React.FC<any> = (props: {
|
|
| 247 |
style={{
|
| 248 |
color: '#FFEB3B',
|
| 249 |
fontSize: '5em',
|
| 250 |
-
fontFamily:
|
| 251 |
borderColor: 'transparent',
|
| 252 |
borderRadius: '2rem',
|
| 253 |
borderLeftWidth: '4px',
|
|
|
|
| 18 |
import { Group } from '../models/Types';
|
| 19 |
import { VideoSplash } from '../anims/VideoSplash';
|
| 20 |
import Transitions from '../../public/assets/transitions.json'
|
|
|
|
| 21 |
|
| 22 |
export type DisplayMedia = SectionMedia &
|
| 23 |
{ idx: number, durationFrames: number, startFrame: number, endFrame: number, }
|
|
|
|
| 36 |
const frame = useCurrentFrame();
|
| 37 |
let speechPath = RenderUtils.getFileName(item?.audioFullPath)
|
| 38 |
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
useEffect(() => {
|
| 41 |
const subFile = staticFile(RenderUtils.getFileName(audioCaptionFile))
|
|
|
|
| 243 |
style={{
|
| 244 |
color: '#FFEB3B',
|
| 245 |
fontSize: '5em',
|
| 246 |
+
fontFamily: 'Poppins',
|
| 247 |
borderColor: 'transparent',
|
| 248 |
borderRadius: '2rem',
|
| 249 |
borderLeftWidth: '4px',
|
src/style.css
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
@tailwind base;
|
| 2 |
@tailwind components;
|
| 3 |
@tailwind utilities;
|
|
|
|
|
|
|
| 4 |
|
| 5 |
@keyframes springBackground {
|
| 6 |
0%, 100% {
|
|
|
|
| 1 |
@tailwind base;
|
| 2 |
@tailwind components;
|
| 3 |
@tailwind utilities;
|
| 4 |
+
@import url("https://fonts.googleapis.com/css2?family=Bangers");
|
| 5 |
+
@import url('https://fonts.googleapis.com/css2?family=Lato&family=Montserrat:wght@700&family=Poppins:wght@400&display=swap');
|
| 6 |
|
| 7 |
@keyframes springBackground {
|
| 8 |
0%, 100% {
|
src/subtitles/excited_Subtitles.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
//@ts-nocheck
|
| 2 |
import React, { useEffect, useState } from 'react'
|
| 3 |
-
import * as SubtitleFont from "@remotion/google-fonts/Montserrat";
|
| 4 |
import { AbsoluteFill, Img, interpolate, interpolateColors, Series, spring, useCurrentFrame, useVideoConfig, random } from "remotion";
|
| 5 |
import { Group, Word } from '../models/Types';
|
| 6 |
import _, { words } from 'lodash'
|
|
@@ -11,10 +10,6 @@ import { RenderUtils } from '../RenderUtils';
|
|
| 11 |
const ExcitedSubtitles: React.FC<{ group: Group, word: Word, position: 'start' | 'center' | 'end' }> = ({
|
| 12 |
word, group }) => {
|
| 13 |
|
| 14 |
-
let { fontFamily } = SubtitleFont.loadFont("normal", {
|
| 15 |
-
weights: ['900']
|
| 16 |
-
})
|
| 17 |
-
|
| 18 |
let frame = useCurrentFrame()
|
| 19 |
let rotation = 0
|
| 20 |
if (group && group.words) {
|
|
@@ -48,7 +43,7 @@ const ExcitedSubtitles: React.FC<{ group: Group, word: Word, position: 'start' |
|
|
| 48 |
justifyContent: 'center',
|
| 49 |
alignContent: 'center'
|
| 50 |
}}
|
| 51 |
-
wordFont=
|
| 52 |
getHighlightStyle={getHighlightStyle}
|
| 53 |
word={word} group={group} position="end" />
|
| 54 |
</div>
|
|
|
|
| 1 |
//@ts-nocheck
|
| 2 |
import React, { useEffect, useState } from 'react'
|
|
|
|
| 3 |
import { AbsoluteFill, Img, interpolate, interpolateColors, Series, spring, useCurrentFrame, useVideoConfig, random } from "remotion";
|
| 4 |
import { Group, Word } from '../models/Types';
|
| 5 |
import _, { words } from 'lodash'
|
|
|
|
| 10 |
const ExcitedSubtitles: React.FC<{ group: Group, word: Word, position: 'start' | 'center' | 'end' }> = ({
|
| 11 |
word, group }) => {
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
let frame = useCurrentFrame()
|
| 14 |
let rotation = 0
|
| 15 |
if (group && group.words) {
|
|
|
|
| 43 |
justifyContent: 'center',
|
| 44 |
alignContent: 'center'
|
| 45 |
}}
|
| 46 |
+
wordFont='Montserrat, sans-serif'
|
| 47 |
getHighlightStyle={getHighlightStyle}
|
| 48 |
word={word} group={group} position="end" />
|
| 49 |
</div>
|
src/subtitles/general_Subtitles.tsx
CHANGED
|
@@ -113,7 +113,7 @@ const GeneralSubtitles: React.FC<{ group: Group, word: Word, position: 'start' |
|
|
| 113 |
key={index}
|
| 114 |
style={{
|
| 115 |
...wordStyle,
|
| 116 |
-
fontFamily: wordFont ||
|
| 117 |
}}
|
| 118 |
>
|
| 119 |
{wordToDisplay?.toUpperCase()}
|
|
|
|
| 113 |
key={index}
|
| 114 |
style={{
|
| 115 |
...wordStyle,
|
| 116 |
+
fontFamily: wordFont || 'Lato, sans-serif'
|
| 117 |
}}
|
| 118 |
>
|
| 119 |
{wordToDisplay?.toUpperCase()}
|