-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
MauiProgram.cs
48 lines (38 loc) · 1.36 KB
/
MauiProgram.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#region Copyright
///////////////////////////////////////////////////////////////////////////////
// File: MauiProgram.cs
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) KGy SOFT, 2005-2024 - All Rights Reserved
//
// You should have received a copy of the LICENSE file at the top-level
// directory of this distribution.
//
// Please refer to the LICENSE file if you want to use this source code.
///////////////////////////////////////////////////////////////////////////////
#endregion
#region Usings
using Microsoft.Maui.Controls.Hosting;
using Microsoft.Maui.Hosting;
using SkiaSharp.Views.Maui.Controls.Hosting;
#endregion
namespace KGySoft.Drawing.Examples.Maui
{
public static class MauiProgram
{
#region Methods
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseSkiaSharp() // this must be added manually to make rendering of SKBitmaps work in a MAUI app
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
return builder.Build();
}
#endregion
}
}