rustdesk/flutter/lib
Bia503 cc0b2ef64f
fix(arm64-linux): fix CJK font rendering on flutter-elinux
The flutter-elinux engine used for ARM64 Linux builds is compiled without
--enable-fontconfig, so Flutter's text shaper cannot discover system fonts.
This causes CJK characters to render as tofu boxes even when fonts such as
Noto Sans CJK are installed. See flutter/flutter#139293.

Fix by loading a CJK font at startup via FontLoader (bypassing fontconfig)
and propagating it through two paths so all text widgets are covered:

1. MyTheme.applyFontFallback() — updates textTheme on both light and dark
   ThemeData so Material components receive the fallback through the theme.

2. _mergeCjkFallback() in GetMaterialApp builders — wraps child widgets in
   DefaultTextStyle.merge so bare Text() widgets and those with inherit:true
   also render CJK characters correctly.

Font discovery queries fc-list for zh, ja, and ko separately, preferring
fonts present in all three sets (true pan-CJK fonts such as NotoSansCJK or
SourceHanSans) over Chinese-only fonts that may lack Japanese kana or Korean
hangul glyphs.  Falls back to a hardcoded search-path list covering
Debian/Ubuntu, Fedora/RHEL, Arch Linux, and WenQuanYi font layouts.

This is an app-level workaround. The engine-level fix is tracked at
flutter/flutter#180235 (open as of 2026-06).

Fixes #10666

Signed-off-by: Bia503 <yinwenche189@gmail.com>
2026-06-18 11:33:22 +00:00
..
common refact(oidc): icon azure to microsoft (#15278) 2026-06-17 14:36:53 +08:00
desktop Refact/printer driver default unchecked (#15191) 2026-06-06 08:51:08 +08:00
mobile fixing https://github.com/rustdesk/rustdesk/issues/15293 2026-06-16 11:36:53 +08:00
models fix(keyboard): wayland clipboard input prompt (#14700) 2026-06-02 16:06:35 +08:00
native fix(arm64-linux): fix CJK font rendering on flutter-elinux 2026-06-18 11:33:22 +00:00
plugin refact: optimize, ID search peers (#10853) 2025-02-20 18:31:12 +08:00
utils feat: Add relative mouse mode (#13928) 2026-01-09 10:03:14 +08:00
web fix(arm64-linux): fix CJK font rendering on flutter-elinux 2026-06-18 11:33:22 +00:00
common.dart fix(arm64-linux): fix CJK font rendering on flutter-elinux 2026-06-18 11:33:22 +00:00
consts.dart Drag whole toolbar; snap to all four edges of the remote session window (#15051) 2026-05-24 19:08:45 +08:00
main.dart fix(arm64-linux): fix CJK font rendering on flutter-elinux 2026-06-18 11:33:22 +00:00