mirror of
https://github.com/2dust/v2rayN.git
synced 2025-11-19 14:12:53 +00:00
* Update AppBuilderExtension.cs * Update package-rhel.sh * Update package-debian.sh * Update AppBuilderExtension.cs * Update AppBuilderExtension.cs * Update AppBuilderExtension.cs * Withdraw * Update AppBuilderExtension.cs
31 lines
814 B
C#
31 lines
814 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using Avalonia;
|
|
using Avalonia.Media;
|
|
|
|
namespace v2rayN.Desktop.Common;
|
|
|
|
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())
|
|
{
|
|
fallbacks.Add(new FontFallback
|
|
{
|
|
FontFamily = new FontFamily("Noto Color Emoji")
|
|
});
|
|
}
|
|
|
|
return appBuilder.With(new FontManagerOptions
|
|
{
|
|
FontFallbacks = fallbacks.ToArray()
|
|
});
|
|
}
|
|
}
|