Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Restores Japanese, Chinese and Korean text rendering in Word and PowerPoint previews using bundled fonts. The impact is limited to viewer font loading and increased package size, without changing stored documents or introducing external font services. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add the CJK font package apps/web/package.json, apps/web/src/components/files/office/fonts-cjk.ts, apps/web/vite.config.ts, third-party-licenses.config.json |
The web app adds @betteroffice/fonts-cjk version 0.4.0, removes the local empty font module and its Vite alias, and adds package license metadata. |
Resolve CJK faces in office documents apps/web/src/components/files/office/fonts.ts, apps/web/src/components/files/office/slide-fonts.ts, apps/web/src/components/files/office/fonts.browser.test.ts |
Word and presentation font selection no longer filters out CJK faces or uses the removed retry helpers. Slide fallback uses resolveScriptFallbackFace. Browser tests compare Japanese font byte lengths with the bundled Noto Sans JP font. |
Estimated code review effort: 2 (Simple) | ~15 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
pingdotgg/t3code, issue 28990: It concerns Japanese glyphs rendering as boxes in the Word viewer, which aligns with this change’s CJK font package and fallback updates.
Suggested reviewers: maria-rcks
Merge Risk: 
Minimal · up to 3bcb0
-
The change enables bundled CJK fonts for Word and PowerPoint. No merge-blocking risk was identified.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the issue, implementation, scope, test results, runtime verification, and remaining limitations.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
|
Note Written by Verified in a real dev environmentverified created a real git project through the app. a real codex
word before: word after: powerpoint before: powerpoint after: fresh-link opening, reopening, and slide navigation: command and runtime transcript Not verifiedthe original windows 11 desktop case, packaged desktop builds, macos, native ios/android, relay/tunnel connections, and production font packaging or size/performance claims were not exercised on this linux vm. japanese and chinese powerpoint already rendered on main here, so those original missing-glyph cases were not reproduced for powerpoint. |
|
Note Claude Opus 5.5 responding on behalf of Natur7a Thanks for the real-app run, the before and after screenshots, and the transcript. The Word result matches the screenshots. On main, the Yu Gothic and MS Gothic tables show boxes for Japanese, Chinese, and Korean. This branch renders all three. I also reproduced this on Windows 11. On main, a Yu Gothic table shows boxes for every Japanese, Chinese, and Korean character while SES, SMTP, and the digits render. On this branch, the Yu Gothic and MS Gothic documents render all three scripts. Windows 11, main, Word:
Windows 11, this branch, Word:
The PowerPoint result differs from the PR description. On this Linux VM, main already renders the Japanese and Chinese slides, and only Korean fails. On Windows 11, main renders the Japanese, Chinese, and Korean slides without boxes, so I could not reproduce a PowerPoint failure there. The description says all three scripts fail in PowerPoint. I will narrow that claim to match what we can reproduce. Windows 11, main, PowerPoint:
Windows 11, this branch, PowerPoint:
The before run used cbd3e14, but the PR is based on e6e2ab0. The 51 commits between them do not touch the office viewer, the font code, the license config, or the Vite config. They also leave the @betteroffice packages unchanged, so the comparison still isolates this change. One correction to the description. fonts.browser.test.ts is new in this PR, so it is not an existing test. It fails 3 of 3 before the fix and passes 3 of 3 after. Still not verified: packaged desktop builds, macOS, and native mobile. |









Problem
Japanese text in a
.docxopened in the file viewer renders as empty boxes, while Latin text and digits render normally. Changing the document font from Yu Gothic to MS Gothic does not help. The same file opens correctly in Microsoft Word. PowerPoint files with Japanese, Chinese or Korean text have the same problem.Reproduce on Windows 11 with the desktop app. Create a
.docxwith a Japanese table in Yu Gothic or MS Gothic, then open it from a link in a thread. Expected: the Japanese text renders.Change
The Word and PowerPoint viewers draw text only with the font files the app gives them, never with system fonts. The app aliased the
@betteroffice/fonts-cjkadd-on to an empty stub to keep about 33 MB of fonts out of the build. As a result, every Japanese, Chinese and Korean family fell back to a Latin face with no CJK glyphs.This PR adds
@betteroffice/fonts-cjk@0.4.0and deletes the stub, its Vite alias, and the filtering inoffice/fonts.tsthat skipped the missing faces.slide-fonts.tsnow callsresolveScriptFallbackFacedirectly. It also adds the Noto CJK license notice tothird-party-licenses.config.json.The faces still load from the app's own files, so no font request leaves the machine. The production build emits them as separate assets. Only the Word and PowerPoint workers reference them, through a 580-byte chunk, so startup and documents without CJK text are unchanged. A Japanese document fetches one 4.5 MB face (3.9 MB gzipped) once, and the browser cache serves it after that. The cost is about 35 MB of extra assets in the desktop app and the
npx t3package. Spreadsheets already draw with system fonts and needed no change.Scope and approval
Fixes issue #28990 . Related to #22039, which was closed as a duplicate.
The change is limited to the Office viewer's font loading. It ships the font package the viewer's font code was written to use, adds no setting, and makes no other behavior change.
Verification
I rendered a Japanese table document in Yu Gothic through the real
WordDocumentviewer and Word engine in Chromium, once before the fix and once after. Only the code differed between the runs, with the add-on installed both times. Before, every Japanese character is a box while "SES", "SMTP" and digits render. After, all the text renders.Before:

After:

apps/web/src/components/files/office/fonts.browser.test.tschecks that Yu Gothic, MS Gothic and the Japanese script fallback load Noto Sans JP. It failed 3 of 3 before the fix (expected undefined to be 4533028) and passes 3 of 3 after.vp buildemits the five CJK faces as separate assets. The web typecheck (tsc --noEmit),vp fmtandvp lintpass on the changed files, and knip passes. I committed with--no-verifybecause the pre-commit hook's lint step hung on Windows without starting. Running that same lint command directly on the staged files passed.Not checked: a Japanese PowerPoint file at runtime (same code path, untested), and the packaged desktop app (same Chromium rendering path as the test above).
Claude Opus 5.5, Claude Code in T3 Code.