8000 More caption fonts, and your own fonts from a folder by Omar-Elwazeery · Pull Request #81 · haziqahmedqasmi/PeakCut · GitHub
[go: up one dir, main page]

Skip to content

More caption fonts, and your own fonts from a folder - #81

Open
Omar-Elwazeery wants to merge 1 commit into
haziqahmedqasmi:mainfrom
Omar-Elwazeery:caption-fonts
Open

Omar-Elwazeery wants to merge 1 commit into
haziqahmedqasmi:mainfrom
Omar-Elwazeery:caption-fonts

Conversation

@Omar-Elwazeery
Copy link
Copy Markdown
Contributor

Closes #78: more caption fonts, and a way to bring your own.

What changes

12 new bundled fonts. Captions can now use 15 fonts: Poppins, Anton and Archivo Black, plus Bebas Neue, Kanit, Barlow Condensed, Paytone One, Righteous, Bangers, Luckiest Guy, Bungee, Rubik Mono One, Black Ops One, Press Start 2P (pixel) and Pacifico (script).

  • Picking one: the font is chosen separately from the caption style: when making clips, in a creator's settings, and in the clip editor. The default is "The style's own font", so nothing changes until someone picks one.
  • Size: each font is resized so its capital letters stand as tall as the style's own font. Switching fonts doesn't make captions jump in size.
  • Previews: the caption style previews redraw in the chosen font.
  • Big text: only the captions change. The big text on top keeps its font.
  • Licences: all are free to bundle (SIL Open Font License; Luckiest Guy is Apache 2.0), and each licence is in studio/fonts.
  • Letter coverage: the fonts were picked because they cover nearly all accented Latin letters. Popular fonts that lack most of them (Permanent Marker, Chewy, Lilita One and others) were left out, because Polish, Czech or Turkish captions would come out in mixed fonts.

Your own fonts. Any .ttf or .otf file in the my-fonts folder (inside the data folder) shows up in the font list under "Your fonts".

  • Preview: the list and the caption style previews show it in its real look.
  • Finding the folder: the folder holds a short how-to note. The owner sees where it is under the font list, with an Open it link on the computer PeakCut runs on.
  • What's skipped: broken files, files over 40 MB, and copies of a bundled font aren't listed.
  • If a font is removed: clips that used it fall back to the style's own font instead of failing.
  • Safety: only fonts in the list can be picked or fetched, so a font name can't point at a file outside the folder.

Fonts installed on the computer. These are listed too with PEAKCUT_SYSTEM_FONTS=1, under "On this computer". The setting is off by default: a computer has hundreds of fonts (symbol fonts and other alphabets among them), and on a server they'd be the server's fonts, not the user's.

A small fix: the "Bounce" preview tile used to show Archivo Black, but Bounce clips are made in Poppins. The preview now shows Poppins.

Settings

  • PEAKCUT_MY_FONTS: a different folder for your own fonts.
  • PEAKCUT_SYSTEM_FONTS=1: also list the computer's fonts.

Both are in .env.example, and the README and AGENTS.md are updated.

Tested

  • python tests/run.py: all 32 test groups pass, including the new tests/test_fonts.py. The new test checks:
    • every font is bundled with its licence;
    • ffmpeg draws every font from its own file, not a stand-in;
    • capitals are the same height in every font;
    • the font choice is kept for videos, creators and clips;
    • a font brought in the folder is listed and makes a real clip;
    • a removed font falls back to the style's own;
    • the computer's fonts are listed when the setting is on.
  • I made frames in every font (accented letters included) and a clip in the system's Impact font, and checked them by eye.
  • On a running copy: the status and font-file routes work, and a request for a file outside the folder is refused.
  • I didn't look at the new controls in a browser.

🤖 Generated with Claude Code

Captions can now be drawn in any of 15 bundled fonts, picked separately from
the caption style: when making clips, in a creator's settings, and in the clip
editor. Each font is resized so its capital letters stand as tall as the
style's own font. The new fonts are free to bundle; their licences are next to
them in studio/fonts.

People can also bring their own: any .ttf or .otf file put in the my-fonts
folder of the data folder shows up in the list, with a preview in that font.
With PEAKCUT_SYSTEM_FONTS=1 the fonts installed on the computer are listed too.
A font that has gone falls back to the style's own, so clips are still made.

Closes haziqahmedqasmi#78

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not an issue, just a recommendation.

1 participant

0