diff --git a/lib/main.dart b/lib/main.dart index 7b85087fb..69a88e699 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -239,6 +239,20 @@ void mainLoop() { final rootNavigatorKey = GlobalKey(); +String? getWindowsFont(AppTheme theme) { + if (!Platform.isWindows) return null; + + final lc = theme.locale?.languageCode.toLowerCase(); + final cc = theme.locale?.scriptCode?.toLowerCase(); + + if (lc == 'ja') return "Yu Gothic"; + if (lc == 'ko') return 'Malgun Gothic'; + if (lc == 'zh' && cc == 'hant') return "Microsoft JhengHei"; + if (lc == 'zh' && cc == 'hans') return "Microsoft YaHei"; + + return null; +} + class Rune extends StatefulWidget { const Rune({super.key}); @@ -281,10 +295,12 @@ class _RuneState extends State { color: appTheme.color, themeMode: appTheme.mode, theme: FluentThemeData( + fontFamily: getWindowsFont(appTheme), accentColor: appTheme.color, visualDensity: VisualDensity.standard, ), darkTheme: FluentThemeData( + fontFamily: getWindowsFont(appTheme), brightness: Brightness.dark, accentColor: appTheme.color, visualDensity: VisualDensity.standard,