Repository navigation
Japanese text names the system's own fonts before Noto Sans JP - #609
Merged
Merged
Conversation
Part of #607. A machine with Noto Sans JP installed in its Bold weight only drew every Japanese glyph bold, because the Japanese stack named it first. Hiragino Sans, Yu Gothic UI, Yu Gothic and Meiryo now come first; a static check pins the order and leaves the base and Chinese stacks as they are.
Deploying cozy-loop-studio with
|
| Latest commit: |
7123867
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7a66dddc.cozy-loop-studio.pages.dev |
| Branch Preview URL: | https://ja-font-system-first.cozy-loop-studio.pages.dev |
Owner
Author
|
CI record for head
|
This was referenced Nov 22, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #607.
What was wrong
On a Windows machine that has Noto Sans JP installed in one weight only (
NotoSansJP-Bold.otf), every Japanese glyph in the interface was drawn in that Bold face: the menu bar at 400, the canvas node names at 500 and the headings at 700 alike. The:lang(ja)stack named 'Noto Sans JP' right after IBM Plex Sans, which has no Japanese glyphs, so the browser took the installed Bold face for every weight.Measured with CDP
CSS.getPlatformFontsForNode(the face the engine really used, not the declared stack), desktop 1280×800, the seawater desalination Template:Korean (Malgun Gothic) and English (IBM Plex Sans) measured the same before and after.
The change
Only the Japanese list in
src/index.csschanges. The platform's own Japanese UI fonts now come before 'Noto Sans JP':'IBM Plex Sans', 'Hiragino Sans', 'Yu Gothic UI', 'Yu Gothic', Meiryo, 'Noto Sans JP', sans-serifHiragino Sans (macOS) and Yu Gothic UI, Yu Gothic and Meiryo (Windows) ship every weight the UI uses. Noto Sans JP stays as the fallback where none of them exists.
Out of scope, as agreed:
Tests
Which font a browser takes depends on what the machine has installed, so there is no browser test.
src/i18n/fontStacks.test.tsis a static check of the order in the stylesheet:On main's stylesheet the order test fails ("Hiragino Sans before Noto Sans JP: expected 2 to be less than 1"). On this branch all 5 pass.
Local runs:
check:*script: 0 failed;tsc -b: clean;cjk-punctuation-font,toolbar-locale-width,run-bar-fit,descriptive-copy-wrapping,node-long-label,i18n-acceptance,template-label-overlay,data-import-guide);mobile.spec.ts:1723, 390 and 320 px), one worker, no retries: 1 passed.Snapshots were compared in these runs, but none of them holds a Japanese image.