Skip to content

fix: use font= for system fonts and avoid duplicate fontfile= in buildTextFilter#1309

Open
sudha09-git wants to merge 1 commit into
magic-peach:mainfrom
sudha09-git:fix/buildTextFilter-font-arg
Open

fix: use font= for system fonts and avoid duplicate fontfile= in buildTextFilter#1309
sudha09-git wants to merge 1 commit into
magic-peach:mainfrom
sudha09-git:fix/buildTextFilter-font-arg

Conversation

@sudha09-git

Copy link
Copy Markdown
Contributor

Fixes #1243

Problem

buildTextFilter in src/lib/text-overlay.ts had two bugs:

  1. System fonts (Arial, Roboto, Poppins etc.) were passed as
    fontfile='Arial' — but fontfile expects a filesystem path, not a
    font name. FFmpeg silently fell back to its default font (Vera),
    so the user's chosen font was never applied to the exported video.

  2. Custom uploaded fonts ended up with duplicate fontfile= arguments:
    fontfile='CustomName':fontfile=/path/to/font.ttf
    causing FFmpeg to reject the export entirely.

Fix

  • System fonts now use :font='FamilyName' (correct FFmpeg parameter)
    only when no custom fontfile path exists
  • Custom fonts continue using :fontfile=/path only, with no redundant
    font-family argument added

@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

@sudha09-git is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Format Check Passed — @sudha09-git

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions github-actions Bot added level:beginner Beginner level - 20 pts type:bug Bug fix labels May 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @sudha09-git!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@sudha09-git

Copy link
Copy Markdown
Contributor Author

Hi @magic-peach

Just a gentle reminder on this PR — all CI checks are passing and this fixes two distinct FFmpeg font bugs (wrong parameter for system fonts + duplicate fontfile= for custom fonts) with a minimal 2-line change.

Could you please review when you get a chance? Happy to make any changes if needed!

@sudha09-git

Copy link
Copy Markdown
Contributor Author

Hi! I've successfully fixed Issue #1243 in PR #1309.

Fix Summary:

  • Changed system fonts to use :font='FamilyName' (correct FFmpeg parameter)
  • Added !fontFileParam check to avoid duplicate fontfile= for custom fonts

Files Changed:

  • src/lib/text-overlay.ts (2 lines added, 2 lines removed)

Testing:

  • All 47 existing tests pass
  • 3 test suites fail, but this is a pre-existing path alias issue
    (fails on main branch too - unrelated to my fix)

The PR is ready for review. Let me know if any changes are needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:beginner Beginner level - 20 pts type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [GSSoC'26] buildTextFilter uses fontfile= for system font names -- all text overlays render in fallback font, never the chosen font

1 participant