mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +00:00
refactor: setup fonts based on operating system
This commit is contained in:
parent
267c955c88
commit
2182d39e5f
6 changed files with 50 additions and 28 deletions
|
@ -1,4 +1,6 @@
|
|||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
@ -11,6 +13,15 @@ namespace SourceGit.Native {
|
|||
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode, SetLastError = false)]
|
||||
private static extern bool PathFindOnPath([In, Out] StringBuilder pszFile, [In] string[] ppszOtherDirs);
|
||||
|
||||
public void SetupFonts(AppBuilder builder) {
|
||||
builder.With(new FontManagerOptions() {
|
||||
DefaultFamilyName = "Microsoft YaHei UI",
|
||||
FontFallbacks = [
|
||||
new FontFallback { FontFamily = new FontFamily("Microsoft YaHei UI") }
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
public string FindGitExecutable() {
|
||||
var reg = Microsoft.Win32.RegistryKey.OpenBaseKey(
|
||||
Microsoft.Win32.RegistryHive.LocalMachine,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue