feat: browser demo font.

This commit is contained in:
Zhang Dian
2024-07-11 03:42:10 +08:00
parent 52556d97ed
commit 6372f409d0
5 changed files with 22 additions and 4 deletions

View File

@@ -0,0 +1,16 @@
using Avalonia;
using Avalonia.Media;
namespace Ursa.Demo.Browser;
public static class AvaloniaAppBuilderExtensions
{
private static string DefaultFontFamily => "avares://Ursa.Demo.Browser/Assets#Source Han Sans CN";
public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
builder.With(new FontManagerOptions
{
DefaultFamilyName = DefaultFontFamily,
FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) } }
});
}