mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 20:45:45 +00:00
- Upgrade SkiaSharp to 3.119.0 for full COLR/CPAL color font support - Add HarfBuzzSharp 8.3.1.1 for text shaping support - Add Windows font fallback for Segoe UI Emoji
32 lines
903 B
C#
32 lines
903 B
C#
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")
|
|
});
|
|
}
|
|
else if (OperatingSystem.IsWindows())
|
|
{
|
|
fallbacks.Add(new FontFallback
|
|
{
|
|
FontFamily = new FontFamily("Segoe UI Emoji")
|
|
});
|
|
}
|
|
|
|
return appBuilder.With(new FontManagerOptions
|
|
{
|
|
FontFallbacks = fallbacks.ToArray()
|
|
});
|
|
}
|
|
}
|