mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
allow OS specific ISystemFontFInder implementations for all build targets above and include .NET Standard 2.0
This commit is contained in:
@@ -76,7 +76,7 @@ namespace UglyToad.PdfPig.Fonts.SystemFonts
|
|||||||
NameSubstitutes = dict;
|
NameSubstitutes = dict;
|
||||||
|
|
||||||
ISystemFontLister lister;
|
ISystemFontLister lister;
|
||||||
#if NETSTANDARD2_0
|
#if NETSTANDARD2_0_OR_GREATER || NET
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
{
|
{
|
||||||
lister = new WindowsSystemFontLister();
|
lister = new WindowsSystemFontLister();
|
||||||
@@ -93,8 +93,10 @@ namespace UglyToad.PdfPig.Fonts.SystemFonts
|
|||||||
{
|
{
|
||||||
throw new NotSupportedException($"Unsupported operating system: {RuntimeInformation.OSDescription}.");
|
throw new NotSupportedException($"Unsupported operating system: {RuntimeInformation.OSDescription}.");
|
||||||
}
|
}
|
||||||
#else
|
#elif NETFRAMEWORK
|
||||||
lister = new WindowsSystemFontLister();
|
lister = new WindowsSystemFontLister();
|
||||||
|
#else
|
||||||
|
#error Missing ISystemFontLister for target framework
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AvailableFonts = new Lazy<IReadOnlyList<SystemFontRecord>>(() => lister.GetAllFonts().ToList());
|
AvailableFonts = new Lazy<IReadOnlyList<SystemFontRecord>>(() => lister.GetAllFonts().ToList());
|
||||||
|
|||||||
Reference in New Issue
Block a user