Skip to content

Commit 8674fca

Browse files
committed
Resolve conflicts
1 parent 9133f2f commit 8674fca

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public string Theme
9696
public string ResultSubFontStyle { get; set; }
9797
public string ResultSubFontWeight { get; set; }
9898
public string ResultSubFontStretch { get; set; }
99-
public string SettingWindowFont { get; set; } = GetSystemDefaultFont(false);
99+
public string SettingWindowFont { get; set; } = Win32Helper.GetSystemDefaultFont(false);
100100
public bool UseGlyphIcons { get; set; } = true;
101101
public bool UseAnimation { get; set; } = true;
102102
public bool UseSound { get; set; } = true;

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -628,21 +628,33 @@ public static void OpenImeSettings()
628628
{ "pt", "Noto Sans" }
629629
};
630630

631-
public static string GetSystemDefaultFont()
631+
/// <summary>
632+
/// Gets the system default font.
633+
/// </summary>
634+
/// <param name="useNoto">
635+
/// If true, it will try to find the Noto font for the current culture.
636+
/// </param>
637+
/// <returns>
638+
/// The name of the system default font.
639+
/// </returns>
640+
public static string GetSystemDefaultFont(bool useNoto = true)
632641
{
633642
try
634643
{
635-
var culture = CultureInfo.CurrentCulture;
636-
var language = culture.Name; // e.g., "zh-TW"
637-
var langPrefix = language.Split('-')[0]; // e.g., "zh"
638-
639-
// First, try to find by full name, and if not found, fallback to prefix
640-
if (TryGetNotoFont(language, out var notoFont) || TryGetNotoFont(langPrefix, out notoFont))
644+
if (useNoto)
641645
{
642-
// If the font is installed, return it
643-
if (Fonts.SystemFontFamilies.Any(f => f.Source.Equals(notoFont)))
646+
var culture = CultureInfo.CurrentCulture;
647+
var language = culture.Name; // e.g., "zh-TW"
648+
var langPrefix = language.Split('-')[0]; // e.g., "zh"
649+
650+
// First, try to find by full name, and if not found, fallback to prefix
651+
if (TryGetNotoFont(language, out var notoFont) || TryGetNotoFont(langPrefix, out notoFont))
644652
{
645-
return notoFont;
653+
// If the font is installed, return it
654+
if (Fonts.SystemFontFamilies.Any(f => f.Source.Equals(notoFont)))
655+
{
656+
return notoFont;
657+
}
646658
}
647659
}
648660

0 commit comments

Comments
 (0)