Registered CJK fonts render dense glyphs
Fixes the reported issue: registered Japanese fonts rendered everyday kanji as notdef blocks — and restores the font registry's own doctrine that validation is loud and registration-time only.
Root cause, measured: the glyph outline budgets were sized from the bundled Latin face's maxp (128 points / 24 contours). Everyday kanji in Noto Sans JP: 鬱 = 237 points/26 contours, 驚 = 185/22, 籠 = 167/22 — every one failed FontGlyphTooComplex per glyph at render time and fell back to blocks.
- Budgets sized from real CJK faces:
maxpread from six production faces (Noto Sans JP/SC/TC/KR, Noto Serif JP, Yuji Mai — table documented at the constants; densest measured: 738 points, 87 contours) →max_glyph_points1024,max_glyph_contours128, with the composite budgets unchanged (measured worst is the bundled face's own 3/4). OnesimpleOutlineframe is live at a time (composites recurse only small component-walk frames), so the parse scratch stays ~9.5 KiB stack; the reference glyph path capacity is now derived from the budgets rather than magic. - Registration-time
maxpgate:Face.parserefuses faces whose declared maxima exceed the budgets, surfaced as a teaching that names the face's numbers against every budget — so a registered id always resolves at render time, and the per-glyph checks remain as commented backstops for under-declaring fonts. - Registration byte bound 2 MiB → 24 MiB: the old bound existed precisely to refuse multi-megabyte CJK fonts the pipeline wasn't sized for — a rationale this fix eliminates (Noto Sans SC is 17.8 MB). Cost is reserved address space only, documented in
canvas_limits.
Proof: synthetic in-test TrueType builders cover dense simple glyphs at the exact budgets, composites at depth, over-declared refusal (all four maxima), and under-declaring backstops; a /tmp-guarded test registers the real 9.6 MB Noto Sans JP through the runtime and outlines + fills 鬱驚籠鑑 at 16/96 px (self-skips without the OFL download — no font binaries committed). Bundled-face inking is byte-identical: all 263 pinned pixel/hash goldens unchanged. Full battery, validate, examples, ts-core e2e all green.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| native-sdk | Preview, Comment | Jul 17, 2026 5:59pm |