File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Flow.Launcher.Infrastructure/UserSettings Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 3
3
using System . Diagnostics ;
4
4
using System . Drawing ;
5
5
using System . Globalization ;
6
+ using System . Linq ;
6
7
using System . Text . Json . Serialization ;
7
8
using System . Windows ;
9
+ using System . Windows . Media ;
8
10
using CommunityToolkit . Mvvm . DependencyInjection ;
9
11
using Flow . Launcher . Infrastructure . Hotkey ;
10
12
using Flow . Launcher . Infrastructure . Logger ;
@@ -41,12 +43,32 @@ public static string GetSystemDefaultFont()
41
43
{
42
44
try
43
45
{
46
+ var systemLanguage = CultureInfo . CurrentCulture . Name ;
44
47
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
+
46
67
if ( font . FamilyNames . TryGetValue ( System . Windows . Markup . XmlLanguage . GetLanguage ( "en-US" ) , out var englishName ) )
47
68
{
48
69
return englishName ;
49
70
}
71
+
50
72
return font . Source ?? "Segoe UI" ;
51
73
}
52
74
catch
You can’t perform that action at this time.
0 commit comments