fix: add CJK font support for Linux (#2719)
CI / format (push) Has been cancelled
CI / test (push) Has been cancelled
CI / packaging (push) Has been cancelled

This commit is contained in:
Mr.Ebonycat
2025-10-04 06:01:33 +08:00
committed by GitHub
parent 8bd9a1d843
commit 5ce851b604
+8
View File
@@ -40,6 +40,14 @@ ThemeData getTheme(ColorMode colorMode, Brightness brightness, DynamicColors? dy
AppLocale.zhHk || AppLocale.zhTw => 'Microsoft JhengHei UI',
_ => 'Segoe UI Variable Display',
};
} else if (checkPlatform([TargetPlatform.linux])) {
fontFamily = switch (LocaleSettings.currentLocale) {
AppLocale.ja => 'Noto Sans CJK JP',
AppLocale.ko => 'Noto Sans CJK KR',
AppLocale.zhCn => 'Noto Sans CJK SC',
AppLocale.zhHk || AppLocale.zhTw => 'Noto Sans CJK TC',
_ => 'Noto Sans',
};
} else {
fontFamily = null;
}