From 054efeb32c3bbd9f5b9c6c0be0a836fd1f7163dc Mon Sep 17 00:00:00 2001 From: JieXu Date: Wed, 19 Nov 2025 16:47:00 +0800 Subject: [PATCH] =?UTF-8?q?[PR]=E6=94=B9=E8=BF=9BEmoji=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=20(#8346)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update AppBuilderExtension.cs * Update package-rhel.sh * Update package-debian.sh * Update AppBuilderExtension.cs * Update AppBuilderExtension.cs * Update AppBuilderExtension.cs * Withdraw * Update AppBuilderExtension.cs --- package-debian.sh | 2 +- package-rhel.sh | 3 ++- .../Common/AppBuilderExtension.cs | 25 ++++++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/package-debian.sh b/package-debian.sh index 2c0ce9da..8b15bb06 100644 --- a/package-debian.sh +++ b/package-debian.sh @@ -28,7 +28,7 @@ Package: v2rayN Version: $Version Architecture: $Arch2 Maintainer: https://github.com/2dust/v2rayN -Depends: libc6 (>= 2.34), fontconfig (>= 2.13.1), desktop-file-utils (>= 0.26), xdg-utils (>= 1.1.3), coreutils (>= 8.32), bash (>= 5.1) +Depends: libc6 (>= 2.34), fontconfig (>= 2.13.1), desktop-file-utils (>= 0.26), xdg-utils (>= 1.1.3), coreutils (>= 8.32), bash (>= 5.1), libfreetype6 (>= 2.11) Description: A GUI client for Windows and Linux, support Xray core and sing-box-core and others EOF diff --git a/package-rhel.sh b/package-rhel.sh index 5ef75ab5..a3ea5406 100644 --- a/package-rhel.sh +++ b/package-rhel.sh @@ -631,13 +631,14 @@ ExclusiveArch: aarch64 x86_64 Source0: __PKGROOT__.tar.gz # Runtime dependencies (Avalonia / X11 / Fonts / GL) -Requires: freetype, cairo, pango, openssl, mesa-libEGL, mesa-libGL +Requires: cairo, pango, openssl, mesa-libEGL, mesa-libGL Requires: glibc >= 2.34 Requires: fontconfig >= 2.13.1 Requires: desktop-file-utils >= 0.26 Requires: xdg-utils >= 1.1.3 Requires: coreutils >= 8.32 Requires: bash >= 5.1 +Requires: freetype >= 2.10 %description v2rayN Linux for Red Hat Enterprise Linux diff --git a/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs b/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs index c0702938..5a3fca95 100644 --- a/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs +++ b/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs @@ -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(); + + 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() }); } }