Skip to content

Commit

Permalink
Merge pull request nissl-lab#1129 from Bykiev/FixSixLaborsFont
Browse files Browse the repository at this point in the history
Specify the Culture while searching the font
  • Loading branch information
tonyqus authored Aug 17, 2023
2 parents b91b047 + 2004c1f commit 1d0c16e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main/SS/Util/SheetUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 1d0c16e

Please sign in to comment.