Compare commits

..

1 commit

Author SHA1 Message Date
JieXu
a15615180b
Merge 2697cddfa6 into 2ebd2b28a8 2025-11-18 12:58:54 +00:00

View file

@ -1,5 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using Avalonia;
using Avalonia.Media;
@ -10,22 +8,22 @@ public static class AppBuilderExtension
{
public static AppBuilder WithFontByDefault(this AppBuilder appBuilder)
{
var fallbacks = new List<FontFallback>();
var notoSansSc = new FontFamily(Path.Combine(Global.AvaAssets, "Fonts#Noto Sans SC"));
fallbacks.Add(new FontFallback { FontFamily = notoSansSc });
if (OperatingSystem.IsLinux())
var fallbacks = new[]
{
fallbacks.Add(new FontFallback
{
FontFamily = new FontFamily("Noto Color Emoji")
});
}
new FontFallback { FontFamily = notoSansSc },
OperatingSystem.IsLinux()
? new FontFallback { FontFamily = new FontFamily("Noto Color Emoji") }
: null
};
var validFallbacks = fallbacks.Where(f => f is not null).ToArray()!;
return appBuilder.With(new FontManagerOptions
{
FontFallbacks = fallbacks.ToArray()
FontFallbacks = validFallbacks
});
}
}