From 4807cd5eb262e9ceaa2c8f181f5fbedf011cd59c Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 23 May 2025 13:24:02 +0800 Subject: [PATCH] fix: if font family name contains '#', make sure we have that built-in font Signed-off-by: leo --- src/App.axaml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index c4e2446b..0664ee25 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -671,7 +671,16 @@ namespace SourceGit prevChar = c; } - trimmed.Add(sb.ToString()); + var name = sb.ToString(); + var idx = name.IndexOf('#'); + if (idx >= 0) + { + if (!name.Equals("fonts:Inter#Inter", StringComparison.Ordinal) && + !name.Equals("fonts:SourceGit#JetBrains Mono", StringComparison.Ordinal)) + continue; + } + + trimmed.Add(name); } return trimmed.Count > 0 ? string.Join(',', trimmed) : string.Empty;