diff --git a/assets/fonts/Shabnam.ttf b/assets/fonts/Shabnam.ttf index dd9de4fb..d9a46c81 100644 Binary files a/assets/fonts/Shabnam.ttf and b/assets/fonts/Shabnam.ttf differ diff --git a/lib/core/app/app_view.dart b/lib/core/app/app_view.dart index cdde1bab..68c65585 100644 --- a/lib/core/app/app_view.dart +++ b/lib/core/app/app_view.dart @@ -19,6 +19,9 @@ class AppView extends HookConsumerWidget with PresLogger { ref.watch(commonControllersProvider); + // HACK temporary solution + final fontFamily = locale.languageCode == "fa" ? "Shabnam" : ""; + return MaterialApp.router( routerConfig: router, locale: locale, @@ -26,8 +29,8 @@ class AppView extends HookConsumerWidget with PresLogger { localizationsDelegates: GlobalMaterialLocalizations.delegates, debugShowCheckedModeBanner: false, themeMode: theme.themeMode, - theme: theme.light, - darkTheme: theme.dark, + theme: theme.light(fontFamily: fontFamily), + darkTheme: theme.dark(fontFamily: fontFamily), title: 'Hiddify', ).animate().fadeIn(); } diff --git a/lib/core/theme/app_theme.dart b/lib/core/theme/app_theme.dart index 14fa86d5..11c6eced 100644 --- a/lib/core/theme/app_theme.dart +++ b/lib/core/theme/app_theme.dart @@ -4,7 +4,9 @@ import 'package:hiddify/core/theme/theme_prefs.dart'; // mostly exact copy of flex color scheme 7.1's fabulous 12 theme extension AppTheme on ThemePrefs { - ThemeData get light { + ThemeData light({ + String fontFamily = "Shabnam", + }) { return FlexThemeData.light( scheme: FlexScheme.indigoM3, surfaceMode: FlexSurfaceMode.highScaffoldLowSurface, @@ -59,11 +61,13 @@ extension AppTheme on ThemePrefs { ), tones: FlexTones.jolly(Brightness.light), visualDensity: FlexColorScheme.comfortablePlatformDensity, - fontFamily: "Shabnam", + fontFamily: fontFamily, ); } - ThemeData get dark { + ThemeData dark({ + String fontFamily = "Shabnam", + }) { return FlexThemeData.dark( scheme: FlexScheme.indigoM3, useMaterial3: true, @@ -119,7 +123,7 @@ extension AppTheme on ThemePrefs { ), // tones: FlexTones.jolly(Brightness.dark), visualDensity: FlexColorScheme.comfortablePlatformDensity, - fontFamily: "Shabnam", + fontFamily: fontFamily, ); } }