From 58d67eb68c9fdb01b2ffba30e136c04038e90641 Mon Sep 17 00:00:00 2001 From: Andrey Bykiev Date: Tue, 25 Jul 2023 15:37:18 +0300 Subject: [PATCH] Specify the Culture while searchig the font Specify the Culture while searchig the font --- main/SS/Util/SheetUtil.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/SS/Util/SheetUtil.cs b/main/SS/Util/SheetUtil.cs index 4d12ad5a8..8e00e6a4b 100644 --- a/main/SS/Util/SheetUtil.cs +++ b/main/SS/Util/SheetUtil.cs @@ -23,6 +23,7 @@ namespace NPOI.SS.Util using System.Collections.Generic; using SixLabors.Fonts; using System.Linq; + using System.Globalization; /** * Helper methods for when working with Usermodel sheets @@ -717,9 +718,9 @@ internal static Font IFont2Font(IFont font1) // use "Arial". TODO-Fonts: More fallbacks. SixLabors.Fonts.FontFamily fontFamily; - if (false == SystemFonts.TryGet(font1.FontName, out fontFamily)) + if (false == SystemFonts.TryGet(font1.FontName, CultureInfo.CurrentCulture, out fontFamily)) { - if (false == SystemFonts.TryGet("Arial", out fontFamily)) + if (false == SystemFonts.TryGet("Arial", CultureInfo.CurrentCulture, out fontFamily)) { fontFamily = SystemFonts.Families.First(); }