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());