From ece4b6af0571511031576cbb283d2c440b444188 Mon Sep 17 00:00:00 2001 From: JieXu Date: Tue, 18 Nov 2025 23:46:40 +0800 Subject: [PATCH] Withdraw --- .../Common/AppBuilderExtension.cs | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs b/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs index 925be53b..ba59adbb 100644 --- a/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs +++ b/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.IO; using Avalonia; using Avalonia.Media; @@ -9,22 +8,22 @@ public static class AppBuilderExtension { public static AppBuilder WithFontByDefault(this AppBuilder appBuilder) { - var fallbacks = new List(); - 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 }); } }