Compare commits

..

No commits in common. "77abecb80ea187a4a62c053ecde2785ddd307bbf" and "2697cddfa622692e0b665161d75afa25fd2b0ab4" have entirely different histories.

View file

@ -1,5 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using Avalonia; using Avalonia;
using Avalonia.Media; using Avalonia.Media;
@ -10,22 +8,22 @@ public static class AppBuilderExtension
{ {
public static AppBuilder WithFontByDefault(this AppBuilder appBuilder) public static AppBuilder WithFontByDefault(this AppBuilder appBuilder)
{ {
var fallbacks = new List<FontFallback>();
var notoSansSc = new FontFamily(Path.Combine(Global.AvaAssets, "Fonts#Noto Sans SC")); 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 new FontFallback { FontFamily = notoSansSc },
{
FontFamily = new FontFamily("Noto Color Emoji") 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 return appBuilder.With(new FontManagerOptions
{ {
FontFallbacks = fallbacks.ToArray() FontFallbacks = validFallbacks
}); });
} }
} }