Skip to content

Give Windows Han text more than one fallback face - #14

Closed
kaylafortin wants to merge 1 commit into
unity/HUB-0000-drop-vendored-accesskitfrom
unity/HUB-8183-cjk-fallback
Closed

kaylafortin wants to merge 1 commit into
unity/HUB-0000-drop-vendored-accesskitfrom
unity/HUB-8183-cjk-fallback

Conversation

@kaylafortin

Copy link
Copy Markdown

On Windows, a Simplified-only Han character such as 简 shaped as a missing-glyph box when the system's Han fallback was a Japanese or Korean UI font. Found in the native Unity Hub (HUB-8183), where the Simplified Chinese language pack shows as ▮体中文 on an English system.

  • Before: DirectWrite answers fontique's script fallback with one face, mapped from the sample character 今 with no locale. When that face lacks a character, nothing else is tried, so 简 draws as .notdef. 繁體中文, 日本語 and 한국어 were fine.
  • Now: ParleyTextSystem::with_script_fallback_families resolves the system's own pick for a script first, then appends the installed families it is given. The Windows text system adds Microsoft YaHei UI, Microsoft JhengHei UI, Yu Gothic UI, Malgun Gothic and SimSun-ExtB after DirectWrite's Han pick. Text the system pick already covers keeps its font, so Japanese text keeps Japanese letterforms.

Testing

direct_write::tests::han_fallback_covers_simplified_only_characters shapes 简体中文, 繁體中文, 日本語 and 한국어 with system fonts and fails on any .notdef. It fails without the fix (简体中文 shaped a .notdef glyph) and passes with it. The full gpui_ce_parley and gpui_ce_windows lib suites pass, with gpui_ce_windows built with test-support,render-to-image.

This branch is unity/HUB-0000-drop-vendored-accesskit, the Hub's current pin, plus this one commit.

🤖 Generated with Claude Code

DirectWrite answers fontique's script fallback with a single face, mapped
from one sample character with no locale. On an English system that pick
can be a Japanese or Korean UI font, so a Simplified-only character such
as 简 has no candidate and shapes as .notdef.

`ParleyTextSystem::with_script_fallback_families` resolves the system's
own pick for a script first, then appends the installed families it is
given. The Windows text system uses it to add the Chinese, Japanese and
Korean UI faces, plus SimSun-ExtB, after DirectWrite's Han pick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chris-addison

Copy link
Copy Markdown
Collaborator

Claudistopher Claudistopher:

Consolidated into unity/hub-consolidated (dfc67e3), the single branch unity-hub now pins. This commit is in it unchanged.

@chris-addison
chris-addison deleted the unity/HUB-8183-cjk-fallback branch October 14, 2026 05:38
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.

2 participants