rustdesk/flutter
Bia503 c9391fb894
fix(arm64-linux): fix CJK font rendering on flutter-elinux (#15324)
* 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>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: Bia503 <yinwenche189@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-18 20:47:24 +08:00
..
android fix(android): waiting for image, one cause (#14919) 2026-04-27 22:37:22 +08:00
assets refact(oidc): icon azure to microsoft (#15278) 2026-06-17 14:36:53 +08:00
ios ios: Enable file sharing and document browser support (#13226) 2025-10-23 15:58:50 +08:00
lib fix(arm64-linux): fix CJK font rendering on flutter-elinux (#15324) 2026-06-18 20:47:24 +08:00
linux fix(linux): enable mouse side buttons in remote sessions (#14848) 2026-04-25 12:46:05 +08:00
macos feat: Add relative mouse mode (#13928) 2026-01-09 10:03:14 +08:00
test autocomplete online (#15313) 2026-06-17 22:04:34 +08:00
windows feat: windows, custom client, update (#13687) 2026-02-27 21:50:20 +08:00
.gitattributes for merge 2022-05-12 16:50:30 +08:00
.gitignore Refact. Build flutter web (#7472) 2024-03-22 13:16:37 +08:00
.metadata fix platform 2022-05-23 16:24:56 +08:00
analysis_options.yaml remove menu from desktop home page 2022-09-19 18:38:19 +08:00
build_android.sh Merge remote-tracking branch 'upstream/master' into file-manager-redesign 2023-02-22 23:01:31 +01:00
build_android_deps.sh linux dynamic load libva (#10171) 2024-12-04 17:10:10 +08:00
build_fdroid.sh more "cargo build --locked" 2026-05-26 11:45:15 +08:00
build_ios.sh fix some build command 2025-05-11 01:15:29 +08:00
ios_arm64.sh more "cargo build --locked" 2026-05-26 11:45:15 +08:00
ios_x64.sh more "cargo build --locked" 2026-05-26 11:45:15 +08:00
ndk_arm.sh more "cargo build --locked" 2026-05-26 11:45:15 +08:00
ndk_arm64.sh more "cargo build --locked" 2026-05-26 11:45:15 +08:00
ndk_x64.sh more "cargo build --locked" 2026-05-26 11:45:15 +08:00
ndk_x86.sh more "cargo build --locked" 2026-05-26 11:45:15 +08:00
pubspec.lock fix: terminal, web, fonts (#12376) 2025-07-22 23:42:05 +08:00
pubspec.yaml bump version 2026-06-17 22:18:45 +08:00
README.md Punctuation correction (#6808) 2024-01-06 11:11:35 +08:00
run.sh more "cargo build --locked" 2026-05-26 11:45:15 +08:00

flutter_hbb

A new Flutter project.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples and guidance on mobile development, and a full API reference.