Skip to content

CJK glyphs missing on desktop (Windows/Linux/macOS) #42

Description

@salmon-21

Description

Non-Latin characters (Japanese, Chinese, Korean) display as ? on desktop platforms. The embedded font PlexSansIcon only covers Latin-1 and icon glyphs.

The Web build bundles LXGW NeoXiHei-Code for CJK coverage (4c262a1), but desktop clientPlatformLocateFontBinary() implementations are stubs.

Note on current Web font

LXGW NeoXiHei uses Simplified Chinese (G-standard) glyph forms — from its README:

将日本写法的字体改造成中国大陆规范写法的尝试

This means shared CJK characters (e.g. 直, 骨, 令) display as Chinese variants, which look incorrect to Japanese users.

Recommended approach

The industry standard for multi-CJK-language applications is locale-based font variant selection:

  1. Bundle region-specific font variants (e.g. Noto Sans CJK JP/SC/TC/KR, ~8MB each)
  2. Detect OS locale at startup
  3. Load the matching variant as a fallback font via ImFontConfig::MergeMode
Locale Font variant Default glyph forms
ja Noto Sans CJK JP Japanese (JIS)
zh-CN Noto Sans CJK SC Simplified Chinese (GB)
zh-TW, zh-HK Noto Sans CJK TC Traditional Chinese
ko Noto Sans CJK KR Korean
Other Noto Sans CJK SC Simplified Chinese (fallback)

Size considerations

Bundling all 4 variants adds ~32MB. Alternatives:

  • Bundle only SC + JP (~16MB) to cover the most likely user bases
  • Use system fonts where available and bundle as fallback
  • Ship a "thin" build and download the font on first launch

Infrastructure already in place

  • clientPlatformLocateFontBinary() API in Platform.hpp
  • Merge-mode font loading in SDLMain.cpp (loads once per session)
  • Web build already demonstrates the pattern with LXGW NeoXiHei-Code

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions