Skip to content

Commit

Permalink
allow OS specific ISystemFontFInder implementations for all build tar…
Browse files Browse the repository at this point in the history
…gets above and include .NET Standard 2.0
  • Loading branch information
michaelschnyder authored and BobLd committed Aug 26, 2023
1 parent 4a480ff commit ee75608
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static SystemFontFinder()
NameSubstitutes = dict;

ISystemFontLister lister;
#if NETSTANDARD2_0
#if NETSTANDARD2_0_OR_GREATER || NET
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
lister = new WindowsSystemFontLister();
Expand All @@ -93,8 +93,10 @@ static SystemFontFinder()
{
throw new NotSupportedException($"Unsupported operating system: {RuntimeInformation.OSDescription}.");
}
#else
#elif NETFRAMEWORK
lister = new WindowsSystemFontLister();
#else
#error Missing ISystemFontLister for target framework
#endif

AvailableFonts = new Lazy<IReadOnlyList<SystemFontRecord>>(() => lister.GetAllFonts().ToList());
Expand Down

0 comments on commit ee75608

Please sign in to comment.