mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-23 01:36:57 -08:00
fix: endless loop when character missing both in current active font and the default font and the fallback font is same with the default.
This commit is contained in:
parent
8f3f011d81
commit
98a46f8211
6 changed files with 15 additions and 18 deletions
|
@ -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()
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -16,9 +16,6 @@ namespace SourceGit.Native
|
|||
builder.With(new FontManagerOptions()
|
||||
{
|
||||
DefaultFamilyName = "PingFang SC",
|
||||
FontFallbacks = [
|
||||
new FontFallback { FontFamily = new FontFamily("PingFang SC") }
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,6 @@ namespace SourceGit.Native
|
|||
builder.With(new FontManagerOptions()
|
||||
{
|
||||
DefaultFamilyName = "Microsoft YaHei UI",
|
||||
FontFallbacks = [
|
||||
new FontFallback { FontFamily = new FontFamily("Microsoft YaHei UI") }
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
<RepositoryUrl>https://github.com/sourcegit-scm/sourcegit.git</RepositoryUrl>
|
||||
<RepositoryType>Public</RepositoryType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
|
||||
<DefineConstants>$(DefineConstants);USE_FONT_INTER</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AvaloniaResource Include="App.ico" />
|
||||
|
@ -47,7 +43,6 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.0.10" />
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.10" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.0.10" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.10" />
|
||||
|
|
|
@ -72,8 +72,6 @@ namespace SourceGit.Views
|
|||
InstalledFonts = new AvaloniaList<FontFamily>();
|
||||
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<FontFamily>();
|
||||
InstalledMonospaceFonts.Add(new FontFamily("fonts:SourceGit#JetBrains Mono"));
|
||||
|
|
Loading…
Reference in a new issue