Skip to content

Commit

Permalink
Use Roboto on non-Windows; use Metal on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymonf committed Oct 22, 2023
1 parent a4af253 commit 961ff9c
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions BAKKA_Editor.Desktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,38 @@ class Program
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
// TODO: make this platform-specific
// .With(new FontManagerOptions { DefaultFamilyName = "avares://BAKKA_Editor/Assets/Roboto-Regular.ttf#Roboto"})
.With(() =>
{
if (!OperatingSystem.IsWindows())
{
return new FontManagerOptions
{
DefaultFamilyName = "avares://BAKKA_Editor/Assets/Roboto-Regular.ttf#Roboto"
};
}
return new FontManagerOptions();
})
.With(() =>
{
if (OperatingSystem.IsMacOS())
{
return new AvaloniaNativePlatformOptions
{
RenderingMode = new[]
{
#pragma warning disable CS0618
// experimental option
AvaloniaNativeRenderingMode.Metal,
#pragma warning restore CS0618
AvaloniaNativeRenderingMode.OpenGl,
AvaloniaNativeRenderingMode.Software
}
};
}
return new AvaloniaNativePlatformOptions();
})
.StartWithClassicDesktopLifetime(args);

// Avalonia configuration, don't remove; also used by visual designer.
Expand Down

0 comments on commit 961ff9c

Please sign in to comment.