From f8792355645b0b25d743eab673404943f7d6e79a Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 5 Feb 2023 20:17:03 +0800 Subject: [PATCH] fix get Win32FamilyNames --- v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs index 6d604d31..2d53ec19 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs @@ -68,7 +68,8 @@ namespace v2rayN.Views { var dir = new DirectoryInfo(Utils.GetFontsPath()); var files = dir.GetFiles("*.ttf"); - var culture = _config.uiItem.currentLanguage.Equals(Global.Languages[0]) ? "zh-cn" : "en-us"; + var culture = _config.uiItem.currentLanguage.Equals(Global.Languages[0]) ? "zh-cn" : "en-us"; + var culture2 = "en-us"; foreach (var it in files) { var families = Fonts.GetFontFamilies(Utils.GetFontsPath(it.Name)); @@ -86,7 +87,11 @@ namespace v2rayN.Views var fontFamily = glyph.Win32FamilyNames[new CultureInfo(culture)]; if (Utils.IsNullOrEmpty(fontFamily)) { - continue; + fontFamily = glyph.Win32FamilyNames[new CultureInfo(culture2)]; + if (Utils.IsNullOrEmpty(fontFamily)) + { + continue; + } } cmbcurrentFontFamily.Items.Add(fontFamily); break;