Skip to content

fix: put the Japanese font first while the interface is in Japanese - #97

Merged
Rn86222 merged 2 commits into
mainfrom
fix/japanese-font-order
Nov 19, 2026
Merged

Rn86222 merged 2 commits into
mainfrom
fix/japanese-font-order

Conversation

@Rn86222

@Rn86222 Rn86222 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Summary

In the Japanese interface, Chrome drew some characters with a system font (Yu Gothic UI on Windows) instead of Noto Sans JP, so they looked out of place. In the first tutorial stage's goal these were 方 in 両方, 生 in 再生, 下 in 右下, and the 」 after 部品.

  • Cause: the font stack from feat(i18n): switch the interface between English and Japanese #93 listed Roboto, Helvetica and Arial before Noto Sans JP. Noto Sans JP from fontsource is split into about 120 files by unicode range, and Chrome skips some characters of such a font when a font installed on the system (here Arial) comes before it. The font files themselves are fine: every character is in them.
  • Reproduction: a blank page loading only @fontsource/noto-sans-jp/400.css shows the same characters missing with the current order, and none with Noto Sans JP first. The variable font package (@fontsource-variable/noto-sans-jp) breaks the same way, so the package is kept.
  • Fix: while <html lang="ja">, the stack puts the Japanese fonts first. The Latin and Japanese font lists are each defined once, and both orders are built from them.
  • Side effect: Latin letters in the Japanese interface now use Noto Sans JP's own letters instead of Arial. The English interface is unchanged.

Testing

  • npx vitest run (173 tests) and npx biome check src pass.
  • In headless Chrome, all 131 characters of the first stage's goal come from Noto Sans JP; before the fix, four were missing. The stack also changes at once when the language is switched after load, including in MUI popups, and switching back to English restores the original order.

🤖 Generated with Claude Code

Rn86222 and others added 2 commits November 19, 2026 22:10
Chrome drew some characters, such as 方 and 生 in the first stage's goal, with a
system font instead of Noto Sans JP. A font split into unicode ranges is missed for
some characters when the fonts before it lack them; with Noto Sans JP first, every
character comes from it. Latin letters in the Japanese interface now use Noto Sans
JP's own, and the English interface is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both orders are built from the same two lists, and the comment names the actual
trigger: an installed font before the split one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with  Cloudflare Pages  Cloudflare Pages

Latest commit: 35ba0f6
Status: ✅  Deploy successful!
Preview URL: https://8edd0f94.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev
Branch Preview URL: https://fix-japanese-font-order.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev

View logs

@Rn86222
Rn86222 merged commit 397d130 into main Nov 19, 2026
2 checks passed
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.

1 participant