mirror of
https://github.com/2dust/v2rayN.git
synced 2025-11-29 03:02:53 +00:00
Compare commits
4 commits
a15615180b
...
39a53ae0e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39a53ae0e6 | ||
|
|
77abecb80e | ||
|
|
ece4b6af05 | ||
|
|
f57cc41058 |
1 changed files with 12 additions and 10 deletions
|
|
@ -1,3 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
|
@ -8,22 +10,22 @@ 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 });
|
||||
|
||||
var fallbacks = new[]
|
||||
if (OperatingSystem.IsLinux())
|
||||
{
|
||||
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()!;
|
||||
fallbacks.Add(new FontFallback
|
||||
{
|
||||
FontFamily = new FontFamily("Noto Color Emoji")
|
||||
});
|
||||
}
|
||||
|
||||
return appBuilder.With(new FontManagerOptions
|
||||
{
|
||||
FontFallbacks = validFallbacks
|
||||
FontFallbacks = fallbacks.ToArray()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue