Skip to content

fix(skills): caption @font-face keeps every per-script font subset - #5510

Closed
VaitaR wants to merge 1 commit into
heygen-com:mainfrom
VaitaR:fix/captions-font-subsets
Closed

VaitaR wants to merge 1 commit into
heygen-com:mainfrom
VaitaR:fix/captions-font-subsets

Conversation

@VaitaR

@VaitaR VaitaR commented Oct 13, 2026

Copy link
Copy Markdown

What

brandFontFaces (captions.mjs in faceless-explainer, product-launch-video, pr-to-video) now declares each per-script subset file as its own @font-face with the matching unicode-range.

Why

Google Fonts / Fontsource ship a face as per-script files (source-serif-4-cyrillic.woff2, source-serif-4-latin.woff2). The dedup key was family+weight+style, so only the alphabetically first file survived. In a Russian explainer the captions got only the Cyrillic subset, and every Latin word and digit fell back to a system font.

Related work

None found.

How

The subset is read from the filename (latin, latin-ext, cyrillic, cyrillic-ext, greek, greek-ext, vietnamese) and added to the dedup key. Ranges are copied from the Google Fonts CSS. If the family name itself contains the subset word, the file is not treated as a subset.

Test plan

  • Unit tests added: build-frame-subsets.test.mjs covers all three workflows. The new tests fail on main (3 fail) and pass with the fix; node --test on that file plus the three captions.test.mjs: 116 pass.
  • Manual testing performed. The bug came from a real faceless-explainer project, but the fix is covered by the unit tests only.
  • Comments follow CONTRIBUTING.md "Comments"

@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down. The diagnosis was right for the code it targeted, but that code no longer exists on main.

#5651 (688229314f, "publish seven knowledge skills aligned with Studio and retire the workflow skills") deleted the faceless-explainer, pr-to-video and product-launch-video skills, including all three captions.mjs copies and build-frame-subsets.test.mjs. brandFontFaces isn't anywhere in the tree any more, so there's nothing left for this fix to apply to. I'd close this one. If the same per-script subset dedup shows up in the new skills or in the CLI font handling, a fresh PR against that code would be welcome.

Need: no, the target was removed by #5651. Size: ok. Reuse: n/a. Simpler: n/a.

— Rames

@jrusso1020 jrusso1020 closed this Oct 24, 2026
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.

2 participants