mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 22:01:10 +08:00
refactor: rewrite the font configuration (#366)
* input font name directly instead of a font picker because localized font family name is not supported by Avalonia * fallback monospace font to default font * remove unused code
This commit is contained in:
@@ -5,7 +5,6 @@ using System.IO;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Native
|
||||
{
|
||||
@@ -37,11 +36,6 @@ namespace SourceGit.Native
|
||||
|
||||
public void SetupApp(AppBuilder builder)
|
||||
{
|
||||
builder.With(new FontManagerOptions()
|
||||
{
|
||||
DefaultFamilyName = "fonts:SourceGit#JetBrains Mono",
|
||||
});
|
||||
|
||||
builder.With(new X11PlatformOptions()
|
||||
{
|
||||
EnableIme = true,
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.Runtime.Versioning;
|
||||
using System.Text;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Native
|
||||
{
|
||||
@@ -15,11 +14,6 @@ namespace SourceGit.Native
|
||||
{
|
||||
public void SetupApp(AppBuilder builder)
|
||||
{
|
||||
builder.With(new FontManagerOptions()
|
||||
{
|
||||
DefaultFamilyName = "PingFang SC",
|
||||
});
|
||||
|
||||
builder.With(new MacOSPlatformOptions()
|
||||
{
|
||||
DisableDefaultApplicationMenuItems = true,
|
||||
|
||||
@@ -8,7 +8,6 @@ using System.Text;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Native
|
||||
{
|
||||
@@ -62,12 +61,6 @@ namespace SourceGit.Native
|
||||
|
||||
public void SetupApp(AppBuilder builder)
|
||||
{
|
||||
builder.With(new FontManagerOptions()
|
||||
{
|
||||
DefaultFamilyName = "Microsoft YaHei UI",
|
||||
FontFallbacks = [new FontFallback { FontFamily = "Microsoft YaHei" }],
|
||||
});
|
||||
|
||||
// Fix drop shadow issue on Windows 10
|
||||
RTL_OSVERSIONINFOEX v = new RTL_OSVERSIONINFOEX();
|
||||
v.dwOSVersionInfoSize = (uint)Marshal.SizeOf<RTL_OSVERSIONINFOEX>();
|
||||
|
||||
Reference in New Issue
Block a user