allow OS specific ISystemFontFInder implementations for all build targets above and include .NET Standard 2.0

This commit is contained in:
Michael Schnyder
2023-08-22 20:28:51 +08:00
committed by BobLd
parent 4a480ffd7f
commit ee756088d9

View File

@@ -76,7 +76,7 @@ namespace UglyToad.PdfPig.Fonts.SystemFonts
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 @@ namespace UglyToad.PdfPig.Fonts.SystemFonts
{
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());