feat: browser demo font.
This commit is contained in:
16
demo/Ursa.Demo.Browser/AvaloniaAppBuilderExtensions.cs
Normal file
16
demo/Ursa.Demo.Browser/AvaloniaAppBuilderExtensions.cs
Normal 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) } }
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user