remotion-dev / remotion

🎥 Make videos programmatically with React
https://remotion.dev
Other
19.59k stars 955 forks source link

New `@remotion/fonts` package with `loadFont()` function #3904

Closed JonnyBurger closed 1 month ago

JonnyBurger commented 1 month ago

This package should just wrap the following function (from here):

import { continueRender, delayRender, staticFile, cancelRender } from "remotion";
 
const waitForFont = delayRender();
const font = new FontFace(
  `Bangers`,
  `url('${staticFile("bangers.woff2")}') format('woff2')`,
);
 
font
  .load()
  .then(() => {
    document.fonts.add(font);
    continueRender(waitForFont);
  })
  .catch((err) => cancelRender(err));

Pain points for users who copy this manually:

We should make an API that is easier: loadFont() and it should live in a new package @remotion/fonts.

Acceptance criteria

  1. Implement a function with this signature:
import {loadFont} from "@remotion/fonts";

await loadFont({
    fontFamily: 'some name',
    url: 'someName',
    weight: '500',
    // ... the other options as seen in the screenshot above
})
  1. Create documentation for this page similar to other packages - main page and 1 page for the specific loadFont() function. All options should be documented and have similar or better quality than the other documentation pages.
  2. Add a sample composition to packages/example so we can test the function. For this, add @remotion/fonts to it's package.json

Bounty

💎 This issue has a bounty on it!

Read our contributing guidelines:

/bounty 300

algora-pbc[bot] commented 1 month ago

## 💎 $300 bounty • Remotion

💎 $200 bounty • Algora

Steps to solve:

  1. Get assigned: If you'd like to work on this issue, comment /attempt below to get assigned
  2. Submit work: Create a pull request including /claim #3904 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Additional opportunities:

Thank you for contributing to remotion-dev/remotion!

Add a bounty • Share on socials

benya7 commented 1 month ago

Hi! I'm interested in working on this. Thank you.

/attempt

algora-pbc[bot] commented 1 month ago

@benya7: The Remotion team prefers to assign a single contributor to the issue rather than let anyone attempt it right away. We recommend waiting for a confirmation from a member before getting started.

JonnyBurger commented 1 month ago

Cool! Good luck @benya7!

abhishek818 commented 1 month ago

Adding myself in the queue..

benya7 commented 1 month ago
algora-pbc[bot] commented 1 month ago

💡 @benya7 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] commented 1 month ago

🎉🎈 @benya7 has been awarded $300! 🎈🎊

algora-pbc[bot] commented 1 month ago

🎉🎈 @benya7 has been awarded $200! 🎈🎊