mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-31 09:35:00 +03:00
[PR]改进Emoji字体兼容性 (#8346)
* Update AppBuilderExtension.cs * Update package-rhel.sh * Update package-debian.sh * Update AppBuilderExtension.cs * Update AppBuilderExtension.cs * Update AppBuilderExtension.cs * Withdraw * Update AppBuilderExtension.cs
This commit is contained in:
@@ -1,14 +1,31 @@
|
||||
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 uri = Path.Combine(Global.AvaAssets, "Fonts#Noto Sans SC");
|
||||
return appBuilder.With(new FontManagerOptions()
|
||||
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())
|
||||
{
|
||||
//DefaultFamilyName = uri,
|
||||
FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(uri) } }
|
||||
fallbacks.Add(new FontFallback
|
||||
{
|
||||
FontFamily = new FontFamily("Noto Color Emoji")
|
||||
});
|
||||
}
|
||||
|
||||
return appBuilder.With(new FontManagerOptions
|
||||
{
|
||||
FontFallbacks = fallbacks.ToArray()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user