Fix Fonts and Missing Glyphs in HyperFrames Renders

Fix fallback fonts, missing CJK glyphs, and broken Arabic shaping in HyperFrames by bundling the correct fonts and sampling frames on the render host.

Updated Dec 4, 2026 · Tested with HyperFrames 0.10.10

A HyperFrames preview can use a font installed on your desktop while a rendered MP4 uses a different face or shows missing-glyph boxes. When a custom family lacks a usable declaration, lint --json can report:

text
font_family_without_font_face

A related warning is font_face_local_only. It means the declaration relies exclusively on local(), so another machine may substitute a different face. An Arabic line with correct glyphs but disjoint letters or reversed words also needs a layout check. Issue #5885 shows how per-letter splits and hand-built word rows can break shaping or bidirectional text.

Bundle the face and weight

Put a licensed font file with coverage for the actual line into the project. In CSS, use a URL relative to the file containing the declaration and use the same family name in the text style. Add additional declarations when you ship additional weights.

css
@font-face {
  font-family: "Caption SC";
  src: url("./assets/fonts/caption-sc.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}
.caption {
  font-family: "Caption SC", sans-serif;
  font-weight: 400;
}

Use a Chinese, Japanese, or Korean face suited to the intended language variant and check that any subset includes the actual characters. For Arabic, preserve logical text order, use lang="ar" and dir="rtl" on the text container where appropriate, and animate a whole line or phrase if character wrapping breaks joining. Check punctuation and numbers alongside Arabic text. HyperFrames composition format

Verify across environments

macOS and Windows. Check the exported frames even if the preview looks right. A family silently satisfied by a system font can disappear when you hand the project to someone else. Fix mismatched weights or filenames in the bundled asset.

Linux and Docker. Verify that the renderer's user can read the font relative to the project and that the filename's case matches exactly. Check that the font file is copied into the final image or mounted with the project.

CI. Include font files in the checkout or build artifacts that reach the runner. Inspect one representative frame per writing system or weight in a test render. In every environment, start with:

bash
npx hyperframes doctor
npx hyperframes lint --json
npx hyperframes snapshot --at 1.5 --no-end

doctor checks the render dependencies. Look at the snapshot to verify the glyphs, line breaks, direction, and weight. Use a timestamp when the affected text is visible. If asset loading stalls instead of substituting a font, see render timeout.

A good font test uses the full string from the finished video. Include longer phrases, mixed Latin and non-Latin text, and punctuation that appears in production. If a file loads but the line still looks wrong, test a regular and bold sample side by side. A missing weight and missing characters can produce different substitutions in the same caption.

Related guides