@@ -628,21 +628,33 @@ public static void OpenImeSettings()
628
628
{ "pt" , "Noto Sans" }
629
629
} ;
630
630
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 )
632
641
{
633
642
try
634
643
{
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 )
641
645
{
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 ) )
644
652
{
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
+ }
646
658
}
647
659
}
648
660
0 commit comments