mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-06-07 02:18:17 +08:00
Integrate font management for Linux demo (#822)
* feat: integrate font management by adding Semi.Avalonia.Demo.Fonts project. * chore: test on ubuntu. * feat: add linux options. * feat: update theme settings and adjust window decorations. * feat: add font to DRM project. * misc: net8.0->net10.0
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Android.Runtime;
|
||||
using Avalonia;
|
||||
using Avalonia.Android;
|
||||
using Semi.Avalonia.Demo.Fonts;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Android;
|
||||
|
||||
@@ -17,4 +18,4 @@ public class Application : AvaloniaAndroidApplication<App>
|
||||
return base.CustomizeAppBuilder(builder)
|
||||
.WithSourceHanSansCNFont();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Android;
|
||||
|
||||
public static class AvaloniaAppBuilderExtensions
|
||||
{
|
||||
private static string DefaultFontFamily => "avares://Semi.Avalonia.Demo.Android/Assets#Source Han Sans CN";
|
||||
|
||||
public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
|
||||
builder.With(new FontManagerOptions
|
||||
{
|
||||
DefaultFamilyName = DefaultFontFamily,
|
||||
FontFallbacks = [new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) }]
|
||||
});
|
||||
}
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Icon.png" Link="Resources\drawable\Icon.png"/>
|
||||
<AvaloniaResource Include="..\Fonts\*" Link="Assets\Fonts\%(Filename)%(Extension)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -31,5 +30,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo.Fonts\Semi.Avalonia.Demo.Fonts.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user