Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ public static void SetFonts(string defaultFont, string monospaceFont, bool onlyU
app._fontsOverrides = null;
}

defaultFont = ProcessFontString(defaultFont);
monospaceFont = ProcessFontString(monospaceFont);

var resDic = new ResourceDictionary();
if (!string.IsNullOrEmpty(defaultFont))
resDic.Add("Fonts.Default", new FontFamily(defaultFont));
Expand Down Expand Up @@ -437,6 +440,28 @@ private static bool TryLaunchAsRebaseMessageEditor(string[] args, out int exitCo
return true;
}

private static string ProcessFontString(string input)
{
if (string.IsNullOrEmpty(input)) return string.Empty;

var parts = input.Split(',');
var result = new StringBuilder();
var isFirst = true;

foreach (var part in parts)
{
var trimmed = part.Trim();
if (!string.IsNullOrEmpty(trimmed))
{
if (!isFirst) result.Append(',');
result.Append(trimmed);
isFirst = false;
}
}

return result.ToString();
}

private bool TryLaunchAsCoreEditor(IClassicDesktopStyleApplicationLifetime desktop)
{
var args = desktop.Args;
Expand Down