mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Change to prioritize Noto Sans font if it is available.
This commit is contained in:
parent
2cf7f97a8b
commit
6ab2df62c2
1 changed files with 23 additions and 1 deletions
|
|
@ -3,8 +3,10 @@ using System.Collections.ObjectModel;
|
|||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
using Flow.Launcher.Infrastructure.Hotkey;
|
||||
using Flow.Launcher.Infrastructure.Logger;
|
||||
|
|
@ -41,12 +43,32 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
{
|
||||
try
|
||||
{
|
||||
var systemLanguage = CultureInfo.CurrentCulture.Name;
|
||||
var font = SystemFonts.MessageFontFamily;
|
||||
|
||||
|
||||
// Set Noto Sans as default font for specific languages
|
||||
switch (systemLanguage)
|
||||
{
|
||||
case "ko-KR":
|
||||
if (Fonts.SystemFontFamilies.Any(f => f.Source.Equals("Noto Sans KR")))
|
||||
return "Noto Sans KR";
|
||||
break;
|
||||
case "ja-JP":
|
||||
if (Fonts.SystemFontFamilies.Any(f => f.Source.Equals("Noto Sans JP")))
|
||||
return "Noto Sans JP";
|
||||
break;
|
||||
case "zh-CN":
|
||||
case "zh-Hans":
|
||||
if (Fonts.SystemFontFamilies.Any(f => f.Source.Equals("Noto Sans SC")))
|
||||
return "Noto Sans SC";
|
||||
break;
|
||||
}
|
||||
|
||||
if (font.FamilyNames.TryGetValue(System.Windows.Markup.XmlLanguage.GetLanguage("en-US"), out var englishName))
|
||||
{
|
||||
return englishName;
|
||||
}
|
||||
|
||||
return font.Source ?? "Segoe UI";
|
||||
}
|
||||
catch
|
||||
|
|
|
|||
Loading…
Reference in a new issue