From ee756088d909bba91c3aa2c1e00574ca6dc0f5e4 Mon Sep 17 00:00:00 2001 From: Michael Schnyder Date: Tue, 22 Aug 2023 20:28:51 +0800 Subject: [PATCH] allow OS specific ISystemFontFInder implementations for all build targets above and include .NET Standard 2.0 --- src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs b/src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs index df16dc703..02043d39c 100644 --- a/src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs +++ b/src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs @@ -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(); @@ -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>(() => lister.GetAllFonts().ToList());