Skip to content

Commit 6688319

Browse files
committed
fix: failed get default font on some Linux distro (sourcegit-scm#447)
1 parent 2a59cdb commit 6688319

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/App.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public override void Initialize()
7575
AvaloniaXamlLoader.Load(this);
7676

7777
var pref = ViewModels.Preference.Instance;
78-
pref.PropertyChanged += (_1, _2) => pref.Save();
78+
pref.PropertyChanged += (_, _) => pref.Save();
7979

8080
SetLocale(pref.Locale);
8181
SetTheme(pref.Theme, pref.ThemeOverrides);

src/Native/Linux.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Runtime.Versioning;
66

77
using Avalonia;
8+
using Avalonia.Media;
89

910
namespace SourceGit.Native
1011
{
@@ -36,6 +37,12 @@ public Linux()
3637

3738
public void SetupApp(AppBuilder builder)
3839
{
40+
// Fix issue https://github.com/sourcegit-scm/sourcegit/issues/447
41+
builder.With(new FontManagerOptions()
42+
{
43+
DefaultFamilyName = "fonts:SourceGit#JetBrains Mono",
44+
});
45+
3946
builder.With(new X11PlatformOptions()
4047
{
4148
EnableIme = true,

src/Resources/Themes.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,6 @@
9999
<SolidColorBrush x:Key="Brush.Link" Color="{DynamicResource Color.Link}"/>
100100

101101
<FontFamily x:Key="Fonts.Default">$Default</FontFamily>
102-
<FontFamily x:Key="Fonts.Monospace">fonts:SourceGit#JetBrains Mono,$Default</FontFamily>
103-
<FontFamily x:Key="Fonts.Primary">fonts:SourceGit#JetBrains Mono,$Default</FontFamily>
102+
<FontFamily x:Key="Fonts.Monospace">fonts:SourceGit#JetBrains Mono</FontFamily>
103+
<FontFamily x:Key="Fonts.Primary">fonts:SourceGit#JetBrains Mono</FontFamily>
104104
</ResourceDictionary>

0 commit comments

Comments
 (0)