diff --git a/src/SourceGit/App.axaml.cs b/src/SourceGit/App.axaml.cs index 29fecf9a..3e1c38a6 100644 --- a/src/SourceGit/App.axaml.cs +++ b/src/SourceGit/App.axaml.cs @@ -175,8 +175,15 @@ namespace SourceGit { AvaloniaXamlLoader.Load(this); - SetLocale(ViewModels.Preference.Instance.Locale); - SetTheme(ViewModels.Preference.Instance.Theme); + var pref = ViewModels.Preference.Instance; + + SetLocale(pref.Locale); + SetTheme(pref.Theme); + + if (string.IsNullOrEmpty(pref.DefaultFont)) + { + pref.DefaultFont = FontManager.Current.DefaultFontFamily.ToString(); + } } public override void OnFrameworkInitializationCompleted() diff --git a/src/SourceGit/Native/Linux.cs b/src/SourceGit/Native/Linux.cs index 0753fdc4..a770abf5 100644 --- a/src/SourceGit/Native/Linux.cs +++ b/src/SourceGit/Native/Linux.cs @@ -4,6 +4,7 @@ using System.Runtime.Versioning; using Avalonia; using Avalonia.Dialogs; +using Avalonia.Media; namespace SourceGit.Native { @@ -12,9 +13,11 @@ namespace SourceGit.Native { public void SetupApp(AppBuilder builder) { -#if USE_FONT_INTER - builder.WithInterFont(); -#endif + builder.With(new FontManagerOptions() + { + DefaultFamilyName = "fonts:SourceGit#JetBrains Mono", + }); + // Free-desktop file picker has an extra black background panel. builder.UseManagedSystemDialogs(); } diff --git a/src/SourceGit/Native/MacOS.cs b/src/SourceGit/Native/MacOS.cs index 6b75e50f..b56ab1ff 100644 --- a/src/SourceGit/Native/MacOS.cs +++ b/src/SourceGit/Native/MacOS.cs @@ -16,9 +16,6 @@ namespace SourceGit.Native builder.With(new FontManagerOptions() { DefaultFamilyName = "PingFang SC", - FontFallbacks = [ - new FontFallback { FontFamily = new FontFamily("PingFang SC") } - ] }); } diff --git a/src/SourceGit/Native/Windows.cs b/src/SourceGit/Native/Windows.cs index 06c0b1dd..f6a5d8af 100644 --- a/src/SourceGit/Native/Windows.cs +++ b/src/SourceGit/Native/Windows.cs @@ -21,9 +21,6 @@ namespace SourceGit.Native builder.With(new FontManagerOptions() { DefaultFamilyName = "Microsoft YaHei UI", - FontFallbacks = [ - new FontFallback { FontFamily = new FontFamily("Microsoft YaHei UI") } - ] }); } diff --git a/src/SourceGit/SourceGit.csproj b/src/SourceGit/SourceGit.csproj index f8a9aace..c24ae8a3 100644 --- a/src/SourceGit/SourceGit.csproj +++ b/src/SourceGit/SourceGit.csproj @@ -19,10 +19,6 @@ https://github.com/sourcegit-scm/sourcegit.git Public - - - $(DefineConstants);USE_FONT_INTER - @@ -47,7 +43,6 @@ - diff --git a/src/SourceGit/Views/Preference.axaml.cs b/src/SourceGit/Views/Preference.axaml.cs index a32e9410..b2da9fd6 100644 --- a/src/SourceGit/Views/Preference.axaml.cs +++ b/src/SourceGit/Views/Preference.axaml.cs @@ -72,8 +72,6 @@ namespace SourceGit.Views InstalledFonts = new AvaloniaList(); InstalledFonts.Add(new FontFamily("fonts:SourceGit#JetBrains Mono")); InstalledFonts.AddRange(FontManager.Current.SystemFonts); - InstalledFonts.Remove(FontManager.Current.DefaultFontFamily); - InstalledFonts.Add(FontManager.Current.DefaultFontFamily); InstalledMonospaceFonts = new AvaloniaList(); InstalledMonospaceFonts.Add(new FontFamily("fonts:SourceGit#JetBrains Mono"));