mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
refactor: add Avalonia.Fonts.Inter
as built-in default font (#447)
This commit is contained in:
parent
6688319714
commit
17dd32456b
4 changed files with 17 additions and 13 deletions
|
@ -58,6 +58,7 @@ namespace SourceGit
|
|||
var builder = AppBuilder.Configure<App>();
|
||||
builder.UsePlatformDetect();
|
||||
builder.LogToTrace();
|
||||
builder.WithInterFont();
|
||||
builder.ConfigureFonts(manager =>
|
||||
{
|
||||
var monospace = new EmbeddedFontCollection(
|
||||
|
@ -219,9 +220,18 @@ namespace SourceGit
|
|||
resDic.Add("Fonts.Monospace", new FontFamily(monospaceFont));
|
||||
}
|
||||
|
||||
var primary = onlyUseMonospaceFontInEditor ? defaultFont : monospaceFont;
|
||||
if (!string.IsNullOrEmpty(primary))
|
||||
resDic.Add("Fonts.Primary", new FontFamily(primary));
|
||||
if (onlyUseMonospaceFontInEditor)
|
||||
{
|
||||
if (string.IsNullOrEmpty(defaultFont))
|
||||
resDic.Add("Fonts.Primary", new FontFamily("fonts:Inter#Inter, $Default"));
|
||||
else
|
||||
resDic.Add("Fonts.Primary", new FontFamily(defaultFont));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(monospaceFont))
|
||||
resDic.Add("Fonts.Primary", new FontFamily(monospaceFont));
|
||||
}
|
||||
|
||||
if (resDic.Count > 0)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue