Skip to content

Commit 6ab2df6

Browse files
committed
Change to prioritize Noto Sans font if it is available.
1 parent 2cf7f97 commit 6ab2df6

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
using System.Diagnostics;
44
using System.Drawing;
55
using System.Globalization;
6+
using System.Linq;
67
using System.Text.Json.Serialization;
78
using System.Windows;
9+
using System.Windows.Media;
810
using CommunityToolkit.Mvvm.DependencyInjection;
911
using Flow.Launcher.Infrastructure.Hotkey;
1012
using Flow.Launcher.Infrastructure.Logger;
@@ -41,12 +43,32 @@ public static string GetSystemDefaultFont()
4143
{
4244
try
4345
{
46+
var systemLanguage = CultureInfo.CurrentCulture.Name;
4447
var font = SystemFonts.MessageFontFamily;
45-
48+
49+
// Set Noto Sans as default font for specific languages
50+
switch (systemLanguage)
51+
{
52+
case "ko-KR":
53+
if (Fonts.SystemFontFamilies.Any(f => f.Source.Equals("Noto Sans KR")))
54+
return "Noto Sans KR";
55+
break;
56+
case "ja-JP":
57+
if (Fonts.SystemFontFamilies.Any(f => f.Source.Equals("Noto Sans JP")))
58+
return "Noto Sans JP";
59+
break;
60+
case "zh-CN":
61+
case "zh-Hans":
62+
if (Fonts.SystemFontFamilies.Any(f => f.Source.Equals("Noto Sans SC")))
63+
return "Noto Sans SC";
64+
break;
65+
}
66+
4667
if (font.FamilyNames.TryGetValue(System.Windows.Markup.XmlLanguage.GetLanguage("en-US"), out var englishName))
4768
{
4869
return englishName;
4970
}
71+
5072
return font.Source ?? "Segoe UI";
5173
}
5274
catch

0 commit comments

Comments
 (0)